PDA

View Full Version : PHP Processes Won't Die


feste12
2004-10-05, 15:54 PM
Lately (the last two weeks), I've been having issues with PHP 4.3.9 on IIS6. PHP processes will spawn and never die off. Typically, during my peak traffic periods, I'll have 25-50 concurrent PHP's open. Just now I logged into my server and saw there were 300+ running. They're not using any CPU - they're just consuming my RAM. Each one is using between 50 - 200kb.

All of the PHP scripts on my site have been written by myself (except for the InvisionBoard forums software). I'm not a perfect programmer, but I haven't had any infinite loop problems with my code in the past.

I've double checked my PHP.ini file, and the max execution time is set to 30 seconds, yet they still refuse to die.

Any ideas on what is causing this? Or how to go about finding the problem?

(On a side note: PHP/mySQL has been a wonderful combination on IIS up until this point.)

:thanks: to anyone who can offer help!

KyleMulligan
2004-10-05, 20:46 PM
I'm assuming you use the CGI interface for PHP. Have you tried switching to something that's perpetual like ISAPI/FastCGI that doesn't have the payload of starting up and shutting down in its execution?

feste12
2004-10-06, 01:13 AM
I've tried a few others...

I initially tried FastCGI (since it's free), but was never able to get it to work. Now, I'm no expert when it comes to server administration, but I feel like I can hold my own. But I tried everything I could think of and followed every tutorial/FAQ on FastCGI and could never get it to run. But I digress...

I also gave Zend's WinEnabler (read: commercial FastCGI) a try. It worked great for a while, but then the PHP processes it had spawned stopped responding after about four hours.

I would love to move away from the CGI PHP implementation as soon as I can get one of the other versions to work. :bang:

Thanks for your suggestions.

Ron
2004-10-06, 09:28 AM
Working with PHP the only reasons I've seen the processes run multiple times and never go away is due to mis-coded loops that run indefinately. The only stop was to kill the website process and then fix the code.

I use the CGI PHP and practiced with ISAPI for a bit on test machines and would always come up with blue screens. At least with CGI it is only a process. I couldn't risk this on a live server and could never figure out why it happened. I planned on testing again with PHP 5 but haven't yet.

ftl001
2004-10-07, 15:21 PM
I use Zend's WinEnabler for an extremely active Invision Board. It will launch 15-20 PHP processes (normal behavior). Most of which are idle. These idle processes will be used if one is busy, so IIS doesn't have to respawn PHP.EXE with every request to the server. I've been using WinEnabler for about 3 months with zero problems.