IIS Application pool hangs for PHP site - Stack Overflow

admin2025-04-25  3

On a Windows Server 2016 Standard with IIS 10.0 I am experiencing serious problems with the IIS application pool hanging for a PHP site written in YII, making the site unresponsive until the pool is restarted. I write hanging because the pool isn't stopped as per the IIS manager. In the beginning it happened only now and then so I just restarted the application pool manually. Then it got worse so I wrote a powershell script to monitor the site and restart the pool when it didn't respond. Lately it has escalated so it now hangs many times a day, and furthermore it turns out that the unresponsiveness is "selective" in that the site often isn't down locally (using the normal url, not localhost), making the script not perform its job.

It is not only locally the unresponsiveness seems selective. For example, it can be down for me, but not for downforeveryoneorjustme etc. Then, how can I know that the application pool is the culprit and not some network problems? Because when I restart the pool, it works again everywhere - until it doesn't.

What's also peculiar is that there is a sister site which is almost identical, only the skin is different. Same YII code, same database etc. Just showing other types of products. And that site rarely (less than once a month) experience the application pool problem.

The site doesn't get much traffic and there is nothing suspicious in the IIS log. NO DDOS type attacks etc, only the usual SQL injection attempts now and then, and they don't coincide with the application pool going down. I am logging Failed Requests but nothing shows up that can explain the problem either. Likewise with the Event log, there are nothing special around the times for the site becoming unresponsive.

I have tried switching pipeline mode for the application pool without any success.

The reason for running PHP in IIS is that there is also a classic ASP site on the server. Otherwise I would simply use Apache. And if I don't find the cause of the problem, I might use Apache anyway and set up a proxy for the ASP site.

But I still hope to find the root cause so this annoying problem can be fixed!

Please advice.

转载请注明原文地址:http://anycun.com/QandA/1745532443a90855.html