IIS 7 and Above
php-cgi.exe hanging a server
Last post Jan 28, 2011 09:17 AM by iis7_nik
Mar 24, 2010 12:26 PM|kkfrost|LINK
I started a thread somewhere but can't find the link.
Oh well, this question is new. I have a W2k8 server, P4 2.4ghz, 2gb mem 1gb free. I'm running the latest 5.3.2 version of PHP NTS. I had tried the 5.2 versions as well.
I am running vBulletin 4.0.2
I have about 10 registered users but I'm the only one on the site pretty much now. When I brought vB up, I would constantly loose my RDP connection to the server and pages would time out. In my troubleshooting, before I would lose my connections, php-cgi.exe
would start spiking.
I had somebody with physical access to the machine verify that activity by just one user on the site would cause php-cgi.exe to hit 100% and freeze the server intermittently until the process finished.
I later tracked this down to the google adsense feature. I turned it off and the site runs great now.
vB support blames it on PHP and recommends I go to linux if I want to get away from these problems. That's not going to happen.
So the question, are they're anyway's to throttle this php exe? I'd like to do something like set it's max proc use to 95% or something so the worse case is a page times out. Not hang up the server to where it's a hard time just staying connected through
Mar 25, 2010 05:35 PM|ksingla|LINK
You can configure %age of CPU to be used for the application pool over a time period. This won't prevent CPU ever hitting 100% but will ensure that CPU is not used over a certain %age over a period. Configuring 80%-90% cpu usage over 1 minute periods might
be safe in your scenario so that CPU can hit 100% maximum of 48-54 seconds (80-90% of a minute). If more CPU cycles are used, apppool will be shutdown for sometime.
Windows system resource manager might be the other option to set max processor usage %age for the process. I haven't used it but you can look into it
Mar 25, 2010 05:41 PM|kkfrost|LINK
Thanks for the response. Actually I did that and caused the server to crash.
Mar 25, 2010 06:39 PM|ksingla|LINK
You need to patch your server to make FastCGI work when cpulimit is turned on. See
http://support.microsoft.com/kb/970208. Hotfix can be requested from
here. Alternatively you can install the hotfix which brings includes bunch of FastCGI improvements including the fix above. This hotfix is available
Mar 26, 2010 08:05 AM|kkfrost|LINK
For everyone, this is only needed for IIS 7.0. These fixes are included in IIS 7.5
Jan 28, 2011 09:17 AM|iis7_nik|LINK
I need some explanation about the cpu limit feature where fastCgi php is turned on.
I have configured my appPool to kill the worker process when a cpu limit is broken. When the event occurs the worker process and the php-cgi.exe process are killed successfully. The application pool is stopped, after few seconds it becomes active. I would
like to know if this stopping time can be configured. For example in my application I want that after a failure due to a cpu limit breaking my application pool starts after X minutes. Does a configuration exist to do it?