PHP high server cpu load with WordPress on a dedicated server

I’m runing two blogs on a dedicated servers, one with 500 unique visitors per day and the other one with 18.000 unique visitors per day, in the cPanel I see the PHP is going up to 99% of CPU load and I have tried many things but nothing solves the load.

The server turns slow with 250 people online, with 500 start the db connection problems and of course the site turns too slowwwwwwwwwww.

Read More

I’ve also tried to deactivate all plugins but seems any of them is the problem.

These are the server specs:

CPU: AMD Athlon™ II X4 - 4x 2.3 GHz 4 Cores
Memory: 8GB Memory DDR3 ECC
Disk Controller: RAID 1 Software
First Hard Drive: 1000GB SATA Drive (7200 RPM)
Second Hard Drive: 1000GB SATA Drive (7200 RPM)
Uplink/Port Speed: 100 Mbps Uplink Port
Public Bandwidth: Unmetered 100Mbps
Operating System: Cent OS 6.2 64 bit
Control Panel Software: cPanel/WHM

[PHP] httpd.conf:

StartServers 5
MinimumSpareServers 5
MinimumSpareServers 10
ServerLimit 256
MaxClients 256
MaxRequestsPerChild 10000
KeepAlive Off
Timeout 60

WordPress Plugins:

Akismet
AZIndex
BackWPup
BulletProof Security
Category Templates Two
Contact Form 7
Easy FancyBox
leenk.me
qTranslate
Really Simple CAPTCHA
Search Everything
SI CAPTCHA Anti-Spam
Stealth Update
Verve Meta Boxes
W3 Total Cache
WordPress File Monitor Plus
WP-PostRatings
WP Total Hacks

Related posts

Leave a Reply

3 comments

  1. Check the memory in use using top to see if it’s hitting a limit and swapping to disk. You should see the swap used at near zero if it’s all configured OK.

    For PHP, add an opcode cacher e.g. APC, memcached, eaccelerator etc. This will take a lot of load off.

    Also, check MySQL. You can trash a huge server if you don’t change the settings from the factory defaults. See here for some thoughts on this. I’d recommend JetProfiler for this. Check the query cache etc to see if it’s used. Low hits on caches means they are too small. Also check for full table scans. Lots means you need to optimise the indexes (use this site to do this) so that slow queries are not a problem.

  2. We are running into a similar problem. It turns out it seems to be the combination Contact Form 7 / Really Simple Captcha in our case. Try disabling those WP Plugins.

    If that works, re-enable it and clear the captcha/tmp dir and the upload/captcha dir. It seems the plug-in doesnt clean up its junk.

    If you already have the latest versions of these plugins (the latest versions DO clean up), then you are probably running in Windows like I am. In Windows, the captcha files are created as Read Only (the Windows filesystem attribute), so the cleaning up fails.

    So if you are using the lastest versions of the plugins AND you are working in Windows,
    then edit file really-simple-captcha.php … Somewhere around line 67 you will see

    $this->file_mode = 0440;
    

    and

    $this->answer_file_mode = 0444;
    

    Change both 0440 and 0444 into 0666. This will fix the clean-up mechanism.

    After doing this, don’t forget to delete the existing tmp files manually, or at least remove their “read-only” Windows filesystem attribute.