0

I've had a WordPress blog I've hosted on Dream Host for several years now. Recently (the past year) my site is going down often. Via Dream Host I found that I'm using up my CPU limit and they are killing my process. This used to happen twice a day, but I was able to get it down to maybe once a week. I did that by swapping my caching plugin from W3 Total Cache to another and removed some plug-ins. I'm still sometime getting my issue. To be honest, I'm an ASP.NET developer, so I'm used to debugging tools in my IDE and CMS applications. How can I get to the bottom of what is causing the CPU issues? Are there any WordPress tools? Also, my site is configured for the URL pattern http://hostname.com/{article slug here} so you'll notice I don't sub-folder by year, month, or category. Could this be contributing to the problem?

0

There are essentially two very different cases how WP site typically bring server down with symptoms of CPU overload:

Your site is not fast enough for your traffic

Simply put if your server can serve page every tenth of a second and you get more than 10 pageviews in that second - your resources are bankrupt. If your site going down heavily correlates with traffic spikes then you need either to make it faster or give it more resources.

You have a bug and/or configuration issue

This is much sneakier since it's not really performance issue. It's issue that causes some kind of crazy loop in a way that really burns CPU. It might not even be in PHP code, for example that tends to happen on some configurations when site attempts HTTP request to itself.

Things to do

  1. Install profiler, the lower level the deeper insight it will give you. NewRelic, munin, xdebug, xhprof, something WP level (P3 Profiler, Time Stack, Laps). Not at the same time! :) Depends on what is your hosting type, etc. Be careful not to crank it up too much from the start since any active debugger/profiler makes site slower to certain degree (ranging from unimportant to killer 300% slowdowns), which might instantly escalate the issue.

  2. Crank up the logging. Turn on WP_DEBUG, disable showing errors, log them to file.

  3. Drag site down to local install, apply the same (sans hiding errors), see how it behaves.

From there it's either having glaring performance issue light up like supernova (consider yourself lucky) or slow hunt for what goes wrong and under which circumstances it manifests.

0

To add to what @rarst said, some problems can be caused by Apache/mysql/php configuration options and they will be almost impossible to debug from wordpress or php and require OS level monitoring tools.

If your problem is typical one, then you will want to look at your apache config file and check what are the values of maxclient and maxservers are. Reducing those values may help your site avoid getting to peak memory and cpu, but will reduce the performance of your site.

Non efficient permalink structure can cause your site to respond slower but should not cause cpu overload.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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