This WordPress-based website i just released is dead slow.

I've optimised my theme a lot and get a pagespeed of 91/100 but the first time to byte is the culprit: it takes 8 up to 20 seconds.

I've installed W3 Total Cache, memcache, APC, eAccelerator, xCache, but the site keeps being super slow.

Server: CentOS 5.7 (x86_64), 2G RAM, CPU: 1 Intel(R) Celeron(R) CPU 2.80GHz Mysql 5.1 PHP: 5.2.7 Apache 2.2

link|improve this question

What happens if you drop some short index.html into the webserver's root for testing purposes? Is wordpress involved in this at all, or does the testsite need as much time? – Johannes Pille Dec 2 '11 at 14:44
Good point, tried that. Even a simple phpinfo(); loads perfectly fast. So it's wordpress related. – pixeline Dec 3 '11 at 1:27
feedback

6 Answers

up vote 5 down vote accepted

If possible get your PHP updated to the latest version 5.3.8.

Before you add your caching layer you need to determine whats slowing down MySql and PHP.

You need to enable WP_Debug and eliminate any PHP errors. Look for undefined indexes, syntax errors and deprecated functions.

That 20 second to first byte is all PHP, MySql and or WordPress related. It sounds like a bad memory leak from poorly written code or extremely long query times.

I would recomend installing the Debug Bar and Debug Bar Extender plugins. Enable profiling and set check points at various parts of your templates like before and after any special queries.

To set a checkpoint use the function: dbgx_checkpoint( $note="" ) Use the $note variable to list where the checkpoint is installed.

The profiler will you record the run times and memory usage to pinpoint any problems.

It will also give you a clear picture of the object cache if your using a WordPress object cache plugin.

Also APC, eAccelerator, xCache will not all work at the same time and blow up your site if you try it (I'm sure you probably meant you tried each of them).

link|improve this answer
thank you, will try these 2 plugins and report. – pixeline Dec 3 '11 at 1:26
feedback

If you realize that the issue is not sever-related, but rather consists of errors or bad-code inside of your (custom) theme, I strongly suggest you run a check on it:

Set your WP_DEBUG to true and install this plugin. It is just a pleasure to use, and it will list all the major (and even minor) snippets, selectors, functions, etc. that should or must be modified.

link|improve this answer
feedback

And have you done a yahoo Yslow - see how many http requests are loaded first off (nothing cached)

It will also help identify what u could do - eg smush images etc

link|improve this answer
feedback

I was in a similar situation. In my case it was the custom-made theme that was not updated for a while. I figured it out by changing the theme to default TwentyTen theme (on a test environment), then made the developer to fix/update the theme code.

link|improve this answer
feedback

In addition to utilizing all the debug information already list try disabling your plugins and turning them back on systematically to help find any one plugin that may need to be refactored. This also goes for the themes. Try switching to a clean copy of wp's 2011 theme.

link|improve this answer
done that. Switching is not an option. Thanks. – pixeline Dec 9 '11 at 22:21
feedback

Provide url it will help to investigate in detail in many cases.

Running wordpress with heavy theme or many plugin make site damn slow. I had same issue and remove some plugin and speed increased drastically. If you are using many plugin try to remove some of them which are not important.

Before removing plugin you can try to disable all plugin and check what speed you are getting. Than you can try one by one plugin. Wordpress plugins are fine to use but drawback is adding each plugin affect website speed.

If you are using any analytic plugin like Wassup or Whos online etc those plugin also make your site little slow. W3 Total if found sometime make site heavy.

Also check your theme javascripts if you have multiple and heavy javascripts that also make trouble. Some cool portfolio theme having bunch of js and causing site slower. Also loading video, images and audio file from other server like Vimeo or youtube etc make site slower. Vimeo is always gives nice trouble if you check in firefox while loading embedded vimeo video it will keep loading n loading.. these all small small things make site slower.

Try to start from disabling plugin and turning on one by one. Than check js, multiple css. even you can check some dynamic php code for e.g. if you have use bloginfo(); in many pages which has to convert into html during rendering that also you can change to html code but its up to you. check embedded data from other server etc..

link|improve this answer
bloginfo(); is loaded automatically on each page load and makes no difference if you are using it 2 times or 30 times. – Chris_O Dec 2 '11 at 16:33
That was just an example wasn't talking about that particular code. :) Idea to say that use html code instead dynamic php whenever possible. – pixelngrain Dec 2 '11 at 16:47
feedback

Your Answer

 
or
required, but never shown

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