Status
Not open for further replies.

damnyou

Active Member
348
2011
8
0
I am getting high server loads and the reason is the php-cgi. It has multiple processes and consuming more than 80% of CPU power. It just appears random. Sometime CPU load is just normal under 1% per minute and stays that way for hours but sometime it is above 3% per minute. I just have wordpress installed and suphp as php handler.

screen:-
http://prntscr.com/1vgdw
http://prntscr.com/1vgfq

Also mysql process is consuming more than 300mb of memory:-
http://prntscr.com/1vgn0

is it normal?
 
7 comments
Couple of things to start. Just run these on your ssh console.

PHP:
mysqladmin -u root -ptmppassword -i 1 processlist

This will show you the processes running in MySQL every second to give you an idea of why it is so huge.


[slide]http://img852.imageshack.us/img852/2394/c565ed4b767546ccbd0e237.png[/slide]

cat /proc/3476/cmdline

This should give you the name of the actual script running. Be sure to change the 3476 to the current pid of the cpu hog.
 
[slide]http://img852.imageshack.us/img852/2394/c565ed4b767546ccbd0e237.png[/slide]



This should give you the name of the actual script running. Be sure to change the 3476 to the current pid of the cpu hog.
OR just use htop it's like top but with much more details... ;)
 
Depends on the size of the site you are running, but I found the issue with running wordpress and in particular the Google Sitemaps XML plugin, is it takes up alot of cpu/memory when it rebuilds the sitemap. In fact, so much so that I actually had to stop it regenerating when a post was published. Instead I setup a crontab to have it run every hour. But if you don't have this plugin installed, I suggest you look at what ones you do have enabled as it is probably one of them.

But my main question is why you aren't using php-fpm to handle php? Its far superior to any other php handler I've used. And before you ask, I have used simple php5-cgi in the past.
 
@ Lock Down
Thanks for the commands, I'll you the same when my internet connection is restored fully.

@ Krun!x
(4 cell plan) 1 CORE X3470 @ 2.93GHz from http://www.balticservers.com/vps-virtual-private-servers. No I didn't optimize the VPS as I dont know how to and it will be very appreciating if you tell me something about that.

@ okone
site map generator is not yet installed as i just reloaded my wordpress installation and I have to install it again.

I dont know how to install php-fpm in kloxo apache and it will be very appreciating if you tell me how to.

BTW I got this guide to configure php handler to pass through php-fpm but can anybody please explain "The PHP Handler" step their, what is site's VirtualHost container? Where is it located?

http://www.hosting.com/support/linux/configure-apache-to-use-php-fpm
 
These are what they call virtual host containers.
<VirtualHost localhost>
ServerName localhost
ServerAlias *.localhost
DocumentRoot /Users/robertcamner/Sites
</VirtualHost>

Normally found in your httpd.conf file.
 
Status
Not open for further replies.
Back
Top