Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am having a problem with CPU usage on my website, and am looking for a way to detect (and fix) what is causing it. A topic not covered in this question.

Following on Hakre answer here, I now realize that what I need to do is profile my PHP calling.

Is it reasonable to put the website on my own computer, run the profiler, and use that information to improve my website?

Any other suggestions on how to do this in the best way?

share|improve this question

4 Answers 4

up vote 6 down vote accepted

Profiling with Profiler-Plugins

Not sure exactly what you need to accomplish with your profiling, but WP Tuner (Wordpress Plugin) goes a long way to finding what is slowing down your WP install.

It looks at each plugin and give your the memory, CPU time and SQL queries involved.

The SQL Monitor (Wordpress Plugin) analyzes SQL performance.

Combine it with W3 Total Cache (Wordpress Plugin) and you should get better performance on any platform.

Also, look to using transient API to store fragments you do not need to generate everytime. This can really help on a slow DB.

share|improve this answer

We have built a PHP profiler on top of XHProf that also uses callgrind output format. The main advantage over XDebug is hugely lower overhead and better recursive function handling, as well as XHProf-style profiling begin and end functions, enabling automated unit testing.

You can see it at http://www.exteon.ro/en/products/php-tools/web3tracer

You will need to compile and use it on your test box though, or ask your hosting provider to install it, but they are not likely to do that.

share|improve this answer

Profiling with Xdebug

I searched for some links so it's easier to read into the topic. I've looked for doing PHP profiling with XDebug, something I would suggest to do:

To display profiling results on the remote site, webgrind might be useful. It's a PHP application that summarizes the profiler output.

I'm not sure if it's possible to provide this all in form of a wordpress plugin (at least there is none available I'm aware of and I don't think that there is something available right now), so you might need to do some of the setup / configuration / profiling on your own.

share|improve this answer

Yes, it is perfectly reasonable to profile the website on your own computer. You will need to install the environment, including the webserver and profile the site using a profiler of choice.

On Windows, local WordPress installation is extremely easy thanks to the Web Platform Installer. Single-click install WordPress including all prerequisites from here.

share|improve this answer
1  
Hmm, using some other operating system than the one where the site is running on (most probably a Unix or Linux) is somehow useless in profiling. Profiling should be done in an environment that matches the target environment as close as possible. –  hakre Aug 24 '10 at 16:04
1  
code is code, if there is a real bottleneck in certain plugin (which is what the OP is after), the profiling will detect this no matter what OS it is running on. Furthermore, he did not specify what OS is his webhost running. Sorry, I am not familiar with other OSes, I provided the link to Windows installer mainly for reference. –  Marek Aug 25 '10 at 7:49
    
Marek - thank you for your link, and answer. Hakre, I see your point although I suspect that for plugin profiling, it would be rather similar on both OS, isn't that true? –  Tal Galili Aug 25 '10 at 13:18
    
Depends on the plugin. I just would not risk to make measurements under another type of system then the life system to come close to it. Can only create headaches and you look in the wrong places etc. - next to that you can better profile under linux then windows. see: hakre.wordpress.com/2010/09/09/… –  hakre Sep 17 '10 at 8:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.