Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 31st July 2009, 02:05
Nicke Nicke is offline
Member
 
Join Date: Jun 2009
Posts: 44
Thanks: 8
Thanked 14 Times in 9 Posts
Default Several php-cgi processes

Hello,

I have followed the perfect server setup for Ubuntu.

I have several php-cgi in top that never closes.
It consumes a lot of memory and i know for a fact that no one is visiting my sites.
The process keeps running even when it's not needed anymore.

I can free up to 200 - 400mb of ram if i reload apache.

What can i do?

Last edited by Nicke; 31st July 2009 at 02:16.
Reply With Quote
Sponsored Links
  #2  
Old 1st August 2009, 09:55
omega13a omega13a is offline
Junior Member
 
Join Date: Aug 2009
Location: California
Posts: 15
Thanks: 1
Thanked 0 Times in 0 Posts
Send a message via ICQ to omega13a Send a message via AIM to omega13a Send a message via MSN to omega13a Send a message via Yahoo to omega13a
Default

I'm having the same problem on CentOS 5.3 with PHP running as a fast cgi. I do not know what is going on. I tried to reconfigure to use mod php or anything other than fast cgi via ISPConfig and I couldn't. I ended up having to deny access to everyone wanting to visit website because not only was I running low on RAM, the load average shot up to like over 50.
__________________
Fish need bicycles!

Last edited by omega13a; 1st August 2009 at 09:57.
Reply With Quote
  #3  
Old 1st August 2009, 11:42
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,001
Thanks: 840
Thanked 5,650 Times in 4,460 Posts
Default

@omega13a

If you use mod_php for all your sites, then you can not have any php-cgi processes. If you dont provide any mor information, you can not expect that someone is able to help you.

@Nicke: Please check the access log of your server if there are any unusual pages accesssed. Long running cgi scripts can be a symtom for a hacked website.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #4  
Old 1st August 2009, 15:28
Nicke Nicke is offline
Member
 
Join Date: Jun 2009
Posts: 44
Thanks: 8
Thanked 14 Times in 9 Posts
Default

Quote:
Originally Posted by till View Post
@Nicke: Please check the access log of your server if there are any unusual pages accesssed. Long running cgi scripts can be a symtom for a hacked website.
I cant find anything strange. I run three small webpages.. with some simple php-scripts. Nothing needs to run for so long.

Right now. Using 834mb ram. 8 processes.
Restarted apache2 -> 417mb ram used.
Reply With Quote
  #5  
Old 2nd August 2009, 15:21
NeeChee NeeChee is offline
Member
 
Join Date: May 2009
Posts: 64
Thanks: 14
Thanked 20 Times in 9 Posts
Default

I do not know if what I am going to say next is possible, but ISPconfig runs a cronjob at * * * * * (all the time) which uses a PHP script. I however do not know if this could be the reason, since it uses /usr/bin/php and not php-cgi of course. This however is the only php-script I know for sure to be running all the time and being run all the time as several instances.

Code:
sudo crontab -u root -l
results in output

Code:
* * * * * /usr/local/ispconfig/server/server.sh > /dev/null 2>> /var/log/ispconfig/cron.log
30 00 * * * /usr/local/ispconfig/server/cron_daily.sh > /dev/null 2>> /var/log/ispconfig/cron.log
Server.sh is started every second and starts a phpscript (/usr/local/ispconfig/server/server.php) which updates server configuration and handles your jobqueue. This means this process is being run every second, and therefore a lot of php processes may be running at the same time.

If this does make any sense, a possible solution could be changing the crontime to once every 10 sec of once every minute. This would result in your jobqueue taking longer to be processed though.

Last edited by NeeChee; 2nd August 2009 at 15:24.
Reply With Quote
  #6  
Old 3rd August 2009, 10:17
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,001
Thanks: 840
Thanked 5,650 Times in 4,460 Posts
Default

The script is run once every minute and not once every second. The crontab is based on minutes and not seconds and this is not related to the problem of Nicke.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #7  
Old 3rd August 2009, 12:49
NeeChee NeeChee is offline
Member
 
Join Date: May 2009
Posts: 64
Thanks: 14
Thanked 20 Times in 9 Posts
Default

Yes, I'm afraid you're quite right about the every minute and not every second... I've got the same problem hence I'm trying to figure out what is going on. I'm just exploring all options. Thanks for ruling it out though.
Reply With Quote
  #8  
Old 3rd August 2009, 12:50
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,001
Thanks: 840
Thanked 5,650 Times in 4,460 Posts
Default

If you post the exact "ps -aux" output of these processes we might be able to help you.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #9  
Old 4th August 2009, 19:58
Nicke Nicke is offline
Member
 
Join Date: Jun 2009
Posts: 44
Thanks: 8
Thanked 14 Times in 9 Posts
Default

Quote:
Originally Posted by till View Post
If you post the exact "ps -aux" output of these processes we might be able to help you.
Code:
web2      3307  0.0  0.2  56308  4852 ?        S    Aug03   0:00 /usr/bin/php-cgi
web2      3309  0.0  0.2  56040  4312 ?        S    Aug03   0:00 /usr/bin/php-cgi
web2      3311  0.0  0.2  56040  4312 ?        S    Aug03   0:00 /usr/bin/php-cgi
web2      3312  0.0  0.2  56040  4312 ?        S    Aug03   0:00 /usr/bin/php-cgi
web2      3313  0.0  0.2  56040  4324 ?        S    Aug03   0:00 /usr/bin/php-cgi
web2      3314  0.0  0.2  56040  4312 ?        S    Aug03   0:00 /usr/bin/php-cgi
web2      3315  0.0  0.2  56040  4312 ?        S    Aug03   0:00 /usr/bin/php-cgi
web2      3316  0.0  0.2  56040  4316 ?        S    Aug03   0:00 /usr/bin/php-cgi
web3     15551  0.0  0.3  55768  8072 ?        Ss   Aug03   0:00 /usr/bin/php-cgi
web3     16336  0.0  0.2  56380  5116 ?        S    Aug03   0:00 /usr/bin/php-cgi
web3     16337  0.0  0.2  56408  5072 ?        S    Aug03   0:00 /usr/bin/php-cgi
web3     16338  0.0  0.2  56264  5008 ?        S    Aug03   0:00 /usr/bin/php-cgi
web3     16340  0.0  0.2  56408  5036 ?        S    Aug03   0:00 /usr/bin/php-cgi
web3     16341  0.0  0.2  56408  5048 ?        S    Aug03   0:00 /usr/bin/php-cgi
web3     16347  0.0  0.2  56408  5052 ?        S    Aug03   0:00 /usr/bin/php-cgi
web3     16348  0.0  0.2  56408  5044 ?        S    Aug03   0:00 /usr/bin/php-cgi
web3     16349  0.0  0.2  56408  5040 ?        S    Aug03   0:00 /usr/bin/php-cgi
web5     23729  0.0  0.3  55768  8072 ?        Ss   Aug03   0:00 /usr/bin/php-cgi
web5     23792  0.0  0.3  56396  6632 ?        S    Aug03   0:00 /usr/bin/php-cgi
web5     23795  0.0  0.3  56392  6880 ?        S    Aug03   0:00 /usr/bin/php-cgi
web5     23796  0.0  0.2  56368  5864 ?        S    Aug03   0:00 /usr/bin/php-cgi
web5     23798  0.0  0.2  56128  6048 ?        S    Aug03   0:00 /usr/bin/php-cgi
web5     23799  0.0  0.3  56392  6700 ?        S    Aug03   0:00 /usr/bin/php-cgi
web5     23800  0.0  0.3  56452  6540 ?        S    Aug03   0:00 /usr/bin/php-cgi
web5     23801  0.0  0.2  56296  5748 ?        S    Aug03   0:00 /usr/bin/php-cgi
web5     23802  0.0  0.3  56452  6548 ?        S    Aug03   0:00 /usr/bin/php-cgi
web2     29865  0.0  0.3  55776  8068 ?        Ss   Aug03   0:00 /usr/bin/php-cgi
web3 uses php but just one script that shows the time on the page. ;-)
I changed to mod_php now. Hope that helps... but it gives me problems when using .htaccess.
I want to turn of the browsing capabilities in some directories but mod_php seems to break that.

I have this in .htaccess: "Options All -Indexes".
The log gives me [Tue Aug 04 19:09:11 2009] [alert] [client xxx.xxx.xxx.xxx] /var/www/xxxxxx/web/xxxx/.htaccess: Options not allowed here, referer: http://www.xxxxxx.xx/xxxx

when using mod_php. Works when using fast-cgi.

Last edited by Nicke; 4th August 2009 at 20:21.
Reply With Quote
  #10  
Old 4th August 2009, 22:41
rukus77 rukus77 is offline
Member
 
Join Date: Apr 2009
Posts: 33
Thanks: 7
Thanked 4 Times in 4 Posts
 
Default

I am having same issue on Centos 5.3 Perfect server setup...

I have 2 Wordpress sites and 2 classifieds sites, both using PHP.

ps -aux output after a reboot...

web1 2809 0.0 0.7 58000 8168 ? Ss 15:32 0:00 /usr/bin/php-cgi
web1 2811 0.2 1.3 61212 13912 ? S 15:32 0:01 /usr/bin/php-cgi
web1 2812 0.3 1.6 65256 16784 ? S 15:32 0:01 /usr/bin/php-cgi
web1 2813 0.0 1.2 61164 12532 ? S 15:32 0:00 /usr/bin/php-cgi
web1 2814 0.3 1.4 62864 14644 ? S 15:32 0:02 /usr/bin/php-cgi
web1 2815 0.0 1.2 61164 12512 ? S 15:32 0:00 /usr/bin/php-cgi
web1 2816 0.0 1.2 61400 12904 ? S 15:32 0:00 /usr/bin/php-cgi
web1 2817 1.0 1.2 61712 12960 ? S 15:32 0:05 /usr/bin/php-cgi
web1 2818 0.1 1.5 64572 16144 ? S 15:32 0:00 /usr/bin/php-cgi
web7 3002 0.0 0.7 58000 7624 ? Ss 15:35 0:00 /usr/bin/php-cgi
web7 3003 0.4 1.6 64692 17088 ? S 15:35 0:01 /usr/bin/php-cgi
web7 3004 0.0 1.1 60740 11644 ? S 15:35 0:00 /usr/bin/php-cgi
web7 3005 0.0 1.1 60740 11640 ? S 15:35 0:00 /usr/bin/php-cgi
web7 3006 0.0 0.2 58000 2688 ? S 15:35 0:00 /usr/bin/php-cgi
web7 3007 0.0 0.2 58000 2688 ? S 15:35 0:00 /usr/bin/php-cgi
web7 3008 0.0 0.2 58000 2688 ? S 15:35 0:00 /usr/bin/php-cgi
web7 3009 0.0 0.2 58000 2688 ? S 15:35 0:00 /usr/bin/php-cgi
web7 3010 0.0 0.2 58000 2688 ? S 15:35 0:00 /usr/bin/php-cgi
web20 3064 0.0 0.7 58000 8096 ? Ss 15:36 0:00 /usr/bin/php-cgi
web20 3065 0.4 1.7 61540 18588 ? S 15:36 0:01 /usr/bin/php-cgi
web20 3066 0.1 1.5 61272 15548 ? S 15:36 0:00 /usr/bin/php-cgi
web20 3067 0.1 1.7 61968 17664 ? S 15:36 0:00 /usr/bin/php-cgi
web20 3068 0.2 1.6 61696 17232 ? S 15:36 0:00 /usr/bin/php-cgi
web20 3070 0.1 1.5 61316 15664 ? S 15:36 0:00 /usr/bin/php-cgi
web20 3071 0.1 1.5 61540 15884 ? S 15:36 0:00 /usr/bin/php-cgi
web20 3072 0.1 1.8 61716 19512 ? S 15:36 0:00 /usr/bin/php-cgi
web20 3073 0.2 1.5 61272 15568 ? S 15:36 0:00 /usr/bin/php-cgi
web20 3077 0.0 0.7 58000 7620 ? Ss 15:36 0:00 /usr/bin/php-cgi
web20 3078 0.3 1.7 61536 18204 ? S 15:36 0:00 /usr/bin/php-cgi
web20 3079 0.0 1.3 60652 13512 ? S 15:36 0:00 /usr/bin/php-cgi
web20 3080 0.1 1.3 60648 13648 ? S 15:36 0:00 /usr/bin/php-cgi
web20 3082 0.0 1.3 60632 13596 ? S 15:36 0:00 /usr/bin/php-cgi
web20 3083 0.2 1.6 61580 17504 ? S 15:36 0:00 /usr/bin/php-cgi
web20 3084 0.1 1.6 61300 17480 ? S 15:36 0:00 /usr/bin/php-cgi
web20 3085 0.1 1.5 61340 15864 ? S 15:36 0:00 /usr/bin/php-cgi
web20 3086 0.0 0.2 58000 2688 ? S 15:36 0:00 /usr/bin/php-cgi

Any suggestions?

Thanks,
Mike
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
ffmpeg Video support for ubuntu 7.10 [suphp-ispconfig] amaurib Installation/Configuration 13 16th February 2010 18:26
Unable to install ISPConfig bdonecker Installation/Configuration 21 26th May 2009 09:20
ISP Config hesitation when opening web pages frankb Installation/Configuration 7 15th December 2008 14:06
ispconfig php 5 errors itamarjp Installation/Configuration 8 25th April 2008 11:20
Apache2 Freezes celtic Server Operation 31 28th May 2007 18:18


All times are GMT +2. The time now is 06:27.


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