Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a Parallel Plesk 11.0.0 with CentOS 6.3. Lately, I've noticed that my web server runs VERY slow (not the norm), CPU average at 80% no matter what kind of traffic, and my top is filled with these:

# top
top - 23:46:02 up 13:14,  1 user,  load average: 70.87, 68.98, 66.78
Tasks: 504 total,  77 running, 426 sleeping,   0 stopped,   1 zombie
Cpu(s): 76.7%us, 22.9%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  0.3%si,  0.0%st
Mem:  16431960k total,  9584416k used,  6847544k free,   322880k buffers
Swap:  4194288k total,        0k used,  4194288k free,  3394184k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
29794 mysql     10 -10 3418m 200m 6592 S 25.5  1.2  16:34.02 mysqld
11166 fstops    20   0  224m  46m 9776 R  8.0  0.3   0:00.27 php-cgi
11149 fstops    20   0  226m  48m 9804 R  7.6  0.3   0:00.30 php-cgi
 9917 fstops    20   0  241m  70m 7744 R  7.3  0.4   0:05.02 php-cgi
11143 fstops    20   0  240m  68m 7684 R  7.3  0.4   0:00.36 php-cgi
11152 fstops    20   0  226m  48m 9804 R  7.3  0.3   0:00.30 php-cgi
11160 fstops    20   0  225m  47m 9788 S  7.3  0.3   0:00.27 php-cgi
11167 fstops    20   0  223m  45m 9772 R  7.3  0.3   0:00.26 php-cgi
11169 fstops    20   0  222m  44m 9752 R  7.3  0.3   0:00.23 php-cgi
11172 fstops    20   0  221m  43m 9720 R  7.3  0.3   0:00.22 php-cgi
11155 fstops    20   0  227m  49m 9780 R  7.0  0.3   0:00.28 php-cgi
11157 fstops    20   0  226m  48m 9804 R  7.0  0.3   0:00.28 php-cgi
11159 fstops    20   0  226m  48m 9804 R  7.0  0.3   0:00.28 php-cgi
11170 fstops    20   0  222m  44m 9728 R  7.0  0.3   0:00.22 php-cgi

Will someone please help me troubleshoot the slowness? Thank you in advance, and please tell me what else I need to report.

share|improve this question
    
the load average is way over limit. did you check the apache logs if you are not beeing hit by a lot of requests? There is even some mysql load, so I am assuming there is actually some heavy page request (or at least heavy for your server... maybe provide a snippet of the apache log –  mlaug Jan 20 '13 at 0:42
    
I have a Wordpress site that gets around 200-300 visitors at any given moment. Nothing seems out of the norm in my logs. –  aZn137 Jan 21 '13 at 1:39

1 Answer 1

php-cgi is by its very nature substantially slower than mod-php. Are you getting more traffic than you used to? It is very possible that an increase in traffic can cause this.

I have very little experience with php-cgi. I would suggest replacing php-cgi with mod-php. Alternatively, if you wish to have security and isolation that comes with php-cgi, have a look at php-fastcgi.

share|improve this answer
    
No, my traffic is as usual, about 200-300 online users at any given moment (based on Google Analytics). –  aZn137 Jan 21 '13 at 1:33
    
If we look at your snapshot of top, your total cpu usage is at ~77%. mysql is at ~26%. The rest of the lines are php-cgi. Assuming this holds true for the rest of the processes, it seems that php-cgi is using ~51% of your cpu. This is far too high for a php app with 200-300 active users. consider changing from php-cgi and also take a look at solutions like apc (php.net/manual/en/book.apc.php) –  drone.ah Jan 21 '13 at 9:04
    
I turned off fastcgi and everything seems fine now; it's back to hovering at 20-40% CPU. Thanks guys. –  aZn137 Jan 22 '13 at 14:19
    
Glad to be of help. Unless its a db heavy website or a lower-spec server, the MySQL CPU usage may also be worth looking at. Maybe some indexes could help ;-) –  drone.ah Jan 23 '13 at 15:35

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.