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 15th April 2011, 12:10
paradoxni paradoxni is offline
Junior Member
 
Join Date: Jun 2008
Posts: 19
Thanks: 1
Thanked 1 Time in 1 Post
Default Fastcgi / mod_cgi processes killing server!

Good Morning,

I have a virtual server with 8GB of ram, running ispconfig 3.0.2.1. A few sites running on this server have fastcgi enabled, however this appears to be killing the server for load and disk access! I keep having to restart apache/mysql to try an get the sites working at a normal speed, but it does not take long to suffer once again.

Not all RAM is getting used and the server is not using swap, however load is consistently high.

I found a post on this forum by someone with a similar issue suggesting that an issue with fastcgi opening too many connections was fixed in 3.0.3, but as of yet I cannot find what this setting is and how to check if I am being affected.

Can anyone point me in the right direct?

thanks,
Reply With Quote
Sponsored Links
  #2  
Old 15th April 2011, 12:48
paradoxni paradoxni is offline
Junior Member
 
Join Date: Jun 2008
Posts: 19
Thanks: 1
Thanked 1 Time in 1 Post
Default

Each Vhost appears to have PHP_FCGI_MAX_REQUESTS=5000 - is this normal PER site?
Reply With Quote
  #3  
Old 15th April 2011, 14:32
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,432
Thanks: 813
Thanked 5,209 Times in 4,085 Posts
Default

The fastcgi default settings have been improved in the last versions. Please update your server to a current ispconfig version (3.0.3.3). Then edit a value in the website settings and click on save so that the vhost gets rewritten and check if this helps.

Also make sure that you install a php binary cache like xcache or eaccelerator.

Quote:
Each Vhost appears to have PHP_FCGI_MAX_REQUESTS=5000 - is this normal PER site?
Thats should be ok. It means that a fastcgi process is terminated after 5000 requeststs and a new one gets started to avoid problems with scripts that eat up your memory.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #4  
Old 18th April 2011, 18:22
JeffryL JeffryL is offline
Member
 
Join Date: Apr 2011
Posts: 36
Thanks: 10
Thanked 0 Times in 0 Posts
Default

I also notice php-cgi is consuming a lot of memory. And instead of the topic starter I don't own a server with 8GB but have only 512. I've also installed php-apc with default configuration (i.e. 32MB). Only a few hits on two sites using php and my memory usage extends to the maximum (both sites running wp) and swap consumption raises to around 400K... and of course this results in a high load.

I use Ubuntu 10.04. Is there some way I could prevent or reduce memory usage by php?

Using mod-php doesn't show the same symptoms and both load and memory are acceptable. For now Fast-cgi results in so many problems I'm using mod-php. But I would prefer using fastcgi though.

Last edited by JeffryL; 18th April 2011 at 18:58.
Reply With Quote
  #5  
Old 18th April 2011, 20:29
JeffryL JeffryL is offline
Member
 
Join Date: Apr 2011
Posts: 36
Thanks: 10
Thanked 0 Times in 0 Posts
Default

Solved by removing apc (Ubuntu 10.04).

Last edited by JeffryL; 18th April 2011 at 20:58.
Reply With Quote
  #6  
Old 18th April 2011, 20:58
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,432
Thanks: 813
Thanked 5,209 Times in 4,085 Posts
Default

I recommend 2GB RAM for a ISPConfig server. Using fastcgi means that there is at least one php process per website, so 512 MB will not be enough. What you can try is to use php-cgi with suexec instead, it is slower but uses less memory then fastcgi, as long as your sites are low traffic.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #7  
Old 18th April 2011, 21:07
JeffryL JeffryL is offline
Member
 
Join Date: Apr 2011
Posts: 36
Thanks: 10
Thanked 0 Times in 0 Posts
Default

Yes, I was already thinking about an upgrade. But for now it's solved by removing php-apc. The server load stays below 1 (instead of 10!) before. Bit slower perhaps, but don't really notice the difference though.
Reply With Quote
  #8  
Old 24th April 2011, 10:30
JeffryL JeffryL is offline
Member
 
Join Date: Apr 2011
Posts: 36
Thanks: 10
Thanked 0 Times in 0 Posts
 
Default

Also working for me is adding these lines to /etc/apache2/mods-enabled/fcgid.conf:

Code:
FcgidMaxProcesses 3
FcgidMaxProcessesPerClass 3
FcgidMinProcessesPerClass 1
This results in less php-cgi processes. It's good to keep in mind though that the FcgidMinProcessesPerClass seems to override the FcgidMaxProcesses (afaik). In my case having 5 websites configured with suexec (and require a different user php-cgi start) still results in 5 processes. Good thing about this, is that requests do not have to wait for other processes to be quit. But if you run many websites this still may still result in many php-cgi processes.

And in apache2.conf:

Code:
ServerLimit 6
in the <IfModule mpm_worker_module> section.

More info about configuring for low memory over here:

http://blog.fosketts.net/2010/07/30/...rivate-server/

Last edited by JeffryL; 24th April 2011 at 10:42.
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
Not working emails (DNS and postfix problem?) shekiman Installation/Configuration 9 1st March 2011 16:25
SSL don't work please help me walner8080 Installation/Configuration 8 26th September 2010 12:07
Can't start apache Musty Server Operation 12 9th March 2008 13:58
Problems with Postfix Mysql Courier PatrickAdrichem Installation/Configuration 3 13th April 2007 15:44
The Perfect Setup Suse 9.3 - Postfix problems new_bee05 HOWTO-Related Questions 20 25th November 2005 02:30


All times are GMT +2. The time now is 10:51.


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