Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm running a bunch of websites on a server but I'm having memory issues from all the PHP processes. What should I change?

I need to change FcgidProcessLifeTime to say 600 right which means the user process will die after 10 minutes?

Should I tweak them in other ways for more permanence?

Current Settings:

MaxRequestsPerProcess 1000
FcgidMaxProcesses 200
FcgidProcessLifeTime 7200
MaxProcessCount 500
FcgidIOTimeout 400
FcgidIdleTimeout 600
FcgidIdleScanInterval 90
FcgidBusyTimeout 300
FcgidBusyScanInterval 80
ErrorScanInterval 3
ZombieScanInterval 3
DefaultMinClassProcessCount 0
DefaultMaxClassProcessCount 3
MaxRequestLen 20468982
share|improve this question

1 Answer 1

The whole point of fcgid is to keep these processes around to minimize overhead from process creation and teardown. You could certainly reduce the time they are kept around to 10 minutes. However, that you are having memory issues (I assume, out of memory issues, or excessive swapping) indicates that you're likely just trying to do too much with too little RAM (eg. you're too far oversold).

If indeed you are out of RAM simply from fcgid under reasonable load conditions, the problem will likely be created even with a lesser process lifetime (as processes are created as needed anyway). Also, underprovisioning to this extent makes you trivial to DoS.

Failing all else, you should adjust the MaxProcessCount directive according to your available resources, and adjust the DefaultMaxClassProcessCount directive if you have issues whereby one site cannot get a process.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.