Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 1st January 2012, 17:39
Snowman Snowman is offline
Senior Member
 
Join Date: Apr 2007
Posts: 116
Thanks: 38
Thanked 3 Times in 3 Posts
Default 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,
Reply With Quote
Sponsored Links
  #2  
Old 1st January 2012, 19:24
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,586
Thanks: 792
Thanked 4,983 Times in 3,903 Posts
Default

Check the apache error.log of the website and the global apache error.log, espcially if there are any vlogger errors.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 1st January 2012, 21:04
Snowman Snowman is offline
Senior Member
 
Join Date: Apr 2007
Posts: 116
Thanks: 38
Thanked 3 Times in 3 Posts
Default

Quote:
Originally Posted by till View Post
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.
Reply With Quote
  #4  
Old 2nd January 2012, 08:17
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,586
Thanks: 792
Thanked 4,983 Times in 3,903 Posts
Default

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.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 2nd January 2012, 10:22
Snowman Snowman is offline
Senior Member
 
Join Date: Apr 2007
Posts: 116
Thanks: 38
Thanked 3 Times in 3 Posts
Default

I am able to login to mysql server at localhost with credentials from /etc/vlogger-dbi.conf, so it seems it's ok..
Reply With Quote
  #6  
Old 2nd January 2012, 10:31
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,586
Thanks: 792
Thanked 4,983 Times in 3,903 Posts
Default

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?
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #7  
Old 2nd January 2012, 10:32
Snowman Snowman is offline
Senior Member
 
Join Date: Apr 2007
Posts: 116
Thanks: 38
Thanked 3 Times in 3 Posts
Default

No I don't, it's let's say default multiserver setup. [only mysql service for websites is on other server]
Reply With Quote
  #8  
Old 2nd January 2012, 10:34
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,586
Thanks: 792
Thanked 4,983 Times in 3,903 Posts
Default

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
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #9  
Old 2nd January 2012, 10:46
Snowman Snowman is offline
Senior Member
 
Join Date: Apr 2007
Posts: 116
Thanks: 38
Thanked 3 Times in 3 Posts
Default

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.
Reply With Quote
  #10  
Old 23rd December 2012, 11:44
voltagetag voltagetag is offline
Junior Member
 
Join Date: Dec 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

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
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache hangs without traffic Thesee General 21 27th September 2011 23:43
Centos 6.0 support Acid_Scorpion Developers' Forum 47 16th September 2011 10:36
Multiserver setup: repquota command not found. CSsab Installation/Configuration 2 27th January 2011 15:11
PHP code for PHPMyAdmin is not parsed parkerj Installation/Configuration 3 26th May 2009 13:40


All times are GMT +2. The time now is 15:55.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.