0

I have a dedicated server. Ever since I upgraded Wordpress to latest version from 2.8.4, I see very high CPU usage. Also I updated the plugins. I use wp super cache. Compression enabled, cache expires in 10 days. More than 45,000 posts.

Memory usage is just 20%, can I make changes so that memory usage may increase to 40%, but CPU load should come down?

Server information

8 cores, all:

Vendor        GenuineIntel
Name        Intel(R) Core(TM) i7 CPU 870 @ 2.93GHz
Speed        2933.533 MHz
Cache        8192 KB

Memory Information

Memory: (16 GB) 16391660k/17825792k available
        (2606k kernel code, 343628k reserved, 1665k data, 224k init)

System Information

Linux 2.6.18-274.17.1.el5 #1 SMP Tue Jan 10 17:25:58 EST 2012 x86_64 x86_64 x86_64 GNU/Linux

Server load     15.88 (8 CPUs)  
Memory Used     19.69% (3,227,356 of 16,394,544)    
Swap Used   0.01% (208 of 2,096,472)

Server Version: Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4
Server Built: May 2 2012 09:35:50

Current Time: Wednesday, 02-May-2012 19:23:09 IST
Restart Time: Wednesday, 02-May-2012 09:48:43 IST
Parent Server Generation: 6
Server uptime: 9 hours 34 minutes 26 seconds
Total accesses: 5691409 - Total Traffic: 99.8 GB
CPU Usage: u103.95 s37.95 cu2261.29 cs0 - 6.97% CPU load
165 requests/sec - 3.0 MB/second - 18.4 kB/request
700 requests currently being processed, 0 idle workers

httpd.conf

keepalive is off

<module prefork.c>
StartServers 5
MinSpareServers 5
MaxSpareServers 15
ServerLimit 700
MaxClients 700
MaxRequestsPerChild 0
</IfModule>

max_connections=256
log-slow-queries = /tmp/slow.log
long_query_time = 1
thread_cache_size = 2512M
tmp_table_size = 4024M
max_heap_table_size = 4024M
query_cache_size = 24M
query_cache_limit = 72M
table_cache = 2048
table_open_cache = 1024
table_definition_cache = 1284M
key_buffer=1024M
read_buffer_size=24M
read_rnd_buffer_size=32M
sort_buffer_size=8M
thread_concurrency = 8 

1 Answer 1

1

try figuring out which process is taking the most of the cpu time - you can start just with running top. is it apache2 [php+serving of the content] or is it mysql? without such basic information it's just a guesswork.

or maybe you have just high load but cpu is mostly idle [busy switching between processes or swapping insanely/waiting for the disk io]?

install munin [or cacti] and start gathering statistics of the server load... it's very useful especially if you have historical data and can easily see what changed from the previous baseline.

if your high server load is caused by plenty of apache processes - maybe it's time to move to more efficient server [ like nginx ] to server your static content [and potentially dynamic one too].

your mysql config looks... strange - you seem to have very high values for tmp_table_size, thread_cache_size and few other values. you can try:

2
  • Most of the times, mysqld takes the most cpu time, and a few times php. May 3, 2012 at 9:43
  • @PreetinderSingh - ok.. checl your mysqlconfig. if you use any custom stuff, add-ons - try profiling slow queries to see if they dont run unnecessary full table scans on some larger tables.
    – pQd
    May 3, 2012 at 9:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .