
1st January 2012, 17:39
|
|
Senior Member
|
|
Join Date: Apr 2007
Posts: 116
Thanks: 38
Thanked 2 Times in 2 Posts
|
|
Apache + php-cgi = CPU 100%
Hi there,
btw happy new year to all  . Since last upgrade of ispconfig, that failed ( http://www.howtoforge.com/forums/showthread.php?t=55116), I have problem with CPU usage of apache and php-cgi. I don't know how to determine if there is so huge number of visitors of websites that i run or if there is some configuration problem related probably to PHP-CGI process.
If I restart apache2 with init script, in 1-2 mins there are 100+ processes like:
13552 ? R 0:00 /usr/bin/php-cgi -d open_basedir=/var/www/clients/client1/web6/web:/var/www/clients/client1/web6/tmp:/var/www/websitewhichihost.com/web:/srv/www/websitewhichihost.com/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/etc/php...
Sometimes there are more than 150 php-cgi processes.
Then my CPU is like : http://www.upnito.sk/0/mvdexp6zk7sc7...jb5adm76wh.png
Every advice from you will be pleasure for me.
Thanks,
|

1st January 2012, 19:24
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,888
Thanks: 693
Thanked 4,188 Times in 3,205 Posts
|
|
Check the apache error.log of the website and the global apache error.log, espcially if there are any vlogger errors.
|

1st January 2012, 21:04
|
|
Senior Member
|
|
Join Date: Apr 2007
Posts: 116
Thanks: 38
Thanked 2 Times in 2 Posts
|
|
Quote:
Originally Posted by till
Check the apache error.log of the website and the global apache error.log, espcially if there are any vlogger errors.
|
These processes that spawn after starting apache are not by same website. There are couple of domains within : /usr/bin/php-cgi -d open_basedir=/var/www/clients/client1/web6/web:/var/www/clients/client1/web6/tmp:/var/www/websitewhichihost.com/web:/srv/www/domain.com/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/etc/php... so probably it's not caused by 1 website.
I will paste some logs :
global /var/log/apache2/error.log
Code:
[Sun Jan 01 20:47:29 2012] [error] child process 23151 still did not exit, sending a SIGKILL
[Sun Jan 01 20:47:29 2012] [error] child process 22584 still did not exit, sending a SIGKILL
[Sun Jan 01 20:47:29 2012] [error] child process 22936 still did not exit, sending a SIGKILL
[Sun Jan 01 20:47:29 2012] [error] child process 22470 still did not exit, sending a SIGKILL
[Sun Jan 01 20:47:29 2012] [error] child process 22963 still did not exit, sending a SIGKILL
[Sun Jan 01 20:47:29 2012] [error] child process 23000 still did not exit, sending a SIGKILL
[Sun Jan 01 20:47:29 2012] [error] child process 22524 still did not exit, sending a SIGKILL
Code:
root@server:~# rgrep vlogger /var/log/
/var/log/apache2/error.log.1:Argument "" isn't numeric in numeric gt (>) at /usr/local/ispconfig/server/scripts/vlogger line 463, <STDIN> line 323971.
/var/log/apache2/error.log.1:DBI connect('database=dbispconfig;host=localhost:3306','ispconfig',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at /usr/local/ispconfig/server/scripts/vlogger line 514
/var/log/apache2/error.log.1:DBI Error: at /usr/local/ispconfig/server/scripts/vlogger line 514, <STDIN> line 344278.
/var/log/apache2/error.log.1:DBI connect('database=dbispconfig;host=localhost:3306','ispconfig',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at /usr/local/ispconfig/server/scripts/vlogger line 514
/var/log/apache2/error.log.1:DBI Error: at /usr/local/ispconfig/server/scripts/vlogger line 514, <STDIN> line 344278.
/var/log/apache2/error.log.1:Use of uninitialized value $DBI_DUMP in alarm at /usr/local/ispconfig/server/scripts/vlogger line 538.
/var/log/apache2/error.log.1:DBI connect('database=dbispconfig;host=localhost:3306','ispconfig',...) failed: Lost connection to MySQL server at 'sending authentication information', system error: 32 at /usr/local/ispconfig/server/scripts/vlogger line 514
/var/log/apache2/error.log.1:DBI Error: at /usr/local/ispconfig/server/scripts/vlogger line 514, <STDIN> line 166512.
/var/log/apache2/error.log.1:DBI connect('database=dbispconfig;host=localhost:3306','ispconfig',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at /usr/local/ispconfig/server/scripts/vlogger line 514
/var/log/apache2/error.log.1:DBI Error: at /usr/local/ispconfig/server/scripts/vlogger line 514, <STDIN> line 168148.
/var/log/apache2/error.log.1:DBI connect('database=dbispconfig;host=localhost:3306','ispconfig',...) failed: Lost connection to MySQL server at 'sending authentication information', system error: 32 at /usr/local/ispconfig/server/scripts/vlogger line 514
/var/log/apache2/error.log.1:DBI Error: at /usr/local/ispconfig/server/scripts/vlogger line 514, <STDIN> line 647276.
/var/log/apache2/error.log.1:DBI connect('database=dbispconfig;host=localhost:3306','ispconfig',...) failed: Lost connection to MySQL server at 'sending authentication information', system error: 32 at /usr/local/ispconfig/server/scripts/vlogger line 514
/var/log/apache2/error.log.1:DBI Error: at /usr/local/ispconfig/server/scripts/vlogger line 514, <STDIN> line 690622.
/var/log/apache2/error.log.1:Argument "" isn't numeric in numeric gt (>) at /usr/local/ispconfig/server/scripts/vlogger line 463, <STDIN> line 273275.
(this log is not from today but from yesterday)
I didn't found nothing more suspicious in logs..
Last edited by Snowman; 1st January 2012 at 21:13.
|

2nd January 2012, 08:17
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,888
Thanks: 693
Thanked 4,188 Times in 3,205 Posts
|
|
Ok, thats what I guessed. Your problem is related to vlogger, please edit the file /etc/vlogger-dbi.conf and ensure that it contains the correct password for the mysql user that is used in that file. You can lookup the correct password in /usr/local/ispconfig/server/lib/config.inc.php. Then restart apache.
|

2nd January 2012, 10:22
|
|
Senior Member
|
|
Join Date: Apr 2007
Posts: 116
Thanks: 38
Thanked 2 Times in 2 Posts
|
|
I am able to login to mysql server at localhost with credentials from /etc/vlogger-dbi.conf, so it seems it's ok..
|

2nd January 2012, 10:31
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,888
Thanks: 693
Thanked 4,188 Times in 3,205 Posts
|
|
Ok.Then the errors might have been just temporary failures e.g. when mysql was restarted. Have you tried to switvh to fastcgi insteas of cgi and do you have a php binary cache like xcache or eacellerator installed?
|

2nd January 2012, 10:32
|
|
Senior Member
|
|
Join Date: Apr 2007
Posts: 116
Thanks: 38
Thanked 2 Times in 2 Posts
|
|
No I don't, it's let's say default multiserver setup. [only mysql service for websites is on other server]
|

2nd January 2012, 10:34
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,888
Thanks: 693
Thanked 4,188 Times in 3,205 Posts
|
|
Then you should switch php to fastcgi in the website settings and install xcache with:
apt-get install php5-xcache
/etc/init.d/apache2 restart
|

2nd January 2012, 10:46
|
|
Senior Member
|
|
Join Date: Apr 2007
Posts: 116
Thanks: 38
Thanked 2 Times in 2 Posts
|
|
OK, you mean that when I login to Ispconfig, I select couple of websites from `top, where php-cgi process is and change the processing php to Fast-CGI? Because all my websites using "Fast-CGI" as php setting in ispconfig.
I installed php5-xcache but, every time I restart apache, when apache is started all CPU's goes to 100% and it spawns these php-cgi processes that uses up to 10% of CPU, but there are lot of them.. and they are dedicated to four or more websites.
|

23rd December 2012, 11:44
|
|
Junior Member
|
|
Join Date: Dec 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I have exactly same problem but couldnt find where it is
My two VPS cpu and ram usage is raised over 100% php-cgi uses 100%, about a ten days i am trying to find solution.
But this seems kind of linux virus
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 07:26.
|
|
Recent comments
1 day 5 hours ago
1 day 10 hours ago
1 day 11 hours ago
1 day 12 hours ago
1 day 14 hours ago
1 day 18 hours ago
1 day 19 hours ago
1 day 21 hours ago
2 days 10 hours ago
2 days 12 hours ago