<div class="post-text" itemprop="description">
We have a busy website that hangs periodically when running a popular open source php program. When hanging (inaccessible 500 error) the cpu and ram look fine on the server, the only odd thing is the 200 or so php-cgi.exe *32 processes that are running, usually we have about 16.
When I RESET IIS the problem goes away and the number of php processes becomes normal.
The IIS maxInstances setting is 0 at the moment, which lets Windows dynamically adjust the value. Some forums have suggested setting it to 10 X #cpu (ie 40 for us) but don't seem to have much reasoning to back up the limiting value.
Whats the downside of limiting the number of php processes, will users be restricted from viewing webpages when that limit is reached? I'ld like to stop my website from hanging or getting 500 error messages but not at the cost of making it inaccessible to some.
Am i managing exisiting php processes incorrectly, should they be recycled or terminated more frequently if not doing anything? (when I load a single page 6 php processes can be spawned and linger for awhile even though they dont appear to be doing anything)
UPDATE: reviewed Zabbix logs during the a recent outage, it shows number of threads and processes increasing every 10 minutes, then decreasing every 10 minutes, presumably due to activity timeout & request timeout being set to 600 seconds. Memory and cpu looked fine at this time. Should I reduce my Activity Timeout value, I think it kills processes that are hung?
Environment:
IIS 7.5
php 5.3.16
14gb Memory
4 cpu
Windows 2008 R2 64-bit
Zend Extension Build API220090626, NTS, VC9
PHP Extension Build API20090626, NTS, VC9
Thread Safety disabled
</div>