logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Third-party Modules View previous topic :: View next topic
Reply to topic   Topic: mod_fcgid high load problems
Author
Smitty



Joined: 03 Jan 2008
Posts: 197

PostPosted: Mon 08 Oct '12 20:50    Post subject: mod_fcgid high load problems Reply with quote

I'm running into some problems with mod_fcgid when my server is under heavy load. When Apache (2.2.23) reaches 300-400 simultaneous requests, I'm seeing many of these warnings in the error log:

Code:
mod_fcgid: can't apply process slot for c:/php/php-cgi.exe


When this happens, the website takes a long time to respond.

My Apache ThreadsPerChild is set to 650. Here are my mod_fcgid settings:

Code:
FcgidInitialEnv PHPRC "c:\php"
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 100000
FcgidMaxRequestLen 536870912
FcgidMaxRequestsPerProcess 100000
FcgidMaxProcessesPerClass 250
FcgidIOTimeout 6000
FcgidBusyTimeout 600


Any ideas? My server is an 8 core Xeon E5-2680 with 64 GB of RAM. Thank you!
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7298
Location: Germany, Next to Hamburg

PostPosted: Mon 08 Oct '12 21:12    Post subject: Reply with quote

You did not define FcgidMaxProcesses
Also FcgidMaxProcessesPerClass limits it in your case to 250 processes. Keep the both equal in number. Increase to more than the number of requests you have.

You should also take a look at FcgidSpawn*

Why do you let your processes die? I run good with FcgidProcessLifeTime 0 else every hour hour server has to kill and restart the fcgid process.

I would also set FcgidFixPathinfo 1
Back to top
Smitty



Joined: 03 Jan 2008
Posts: 197

PostPosted: Mon 08 Oct '12 21:32    Post subject: Reply with quote

Right, I don't have FcgidMaxProcesses defined so it uses the default of 1000. I'll try setting it to 250 to match FcgidMaxProcessesPerClass.

I checked my php.ini and by default cgi.fix_pathinfo is commented out. But a quick phpinfo() check shows that cgi.fix_pathinfo is already set to 1. I'll set the mod_fcgid variable to match that default setting.

Also, I'm not defining FcgidProcessLifeTime, so it is the default of 3600 seconds. If you set it to 0, it doesn't end up killing the processes. Don't you want it to kill the processes and start new ones for new connections?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7298
Location: Germany, Next to Hamburg

PostPosted: Tue 09 Oct '12 11:11    Post subject: Reply with quote

Smitty wrote:

Also, I'm not defining FcgidProcessLifeTime, so it is the default of 3600 seconds. If you set it to 0, it doesn't end up killing the processes. Don't you want it to kill the processes and start new ones for new connections?


If not defined a single php-cgi.exe process will handle N rquests for one hour. Than it dies and maybe / properbly apache has to start a new process. And no fcgid reuses the running php-cgi process. Reuse is the whole thing what fcgid is about. That is the technic that makes it much faster than the older cgi / cgid.

To increase the performance I let never die a php-cgi process from apache. it might happen when something goes very wrong that I kill a single php-cgi process by hand.
Back to top


Reply to topic   Topic: mod_fcgid high load problems View previous topic :: View next topic
Post new topic   Forum Index -> Third-party Modules