Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP freaking out (connection dropped, connection abandoned) in IIS 7.5

Tags:

php

windows

iis

dll

I'm having some problems with IIS and PHP (plus a com dll). The COM dll crashes fairly often, but I think the problems are not due to that (i have disabled rapid fail protection), because the dll always crashed, while the problems started about three weeks ago when we reached about 15.000 users/day.

What happens is that suddenly all .php files stop responding and the server is only able to serve static .htm files, which indicates there is a problem with php (php-cgi.exe).

This almost always happen during peak hours ( 3-4-5PM ) when google analytics shows 180-220 "online users". When this happens (the freaking out of PHP i mean) I can see in the server's task manager that instead of normally 10-12 php-cgi.exe processes they spike up to 30 or 40 php-cgi.exe processes ( of ~30 MB RAM each) , which I guess happens because php-cgi.exe stops handling the requests. The server has a total of 8GB RAM.

The error logs include both connection_abandoned_by_regqueue and connection_dropped and if I don't manually restart IIS or the defaultapppool, the errors will turn most of the times into defaultapppool not available 503

One issue is that in the event viewer I never get a message from WAS that the defaultapppool was disabled so that I could attach a task ( of restarting the pool) to it and in the IIS management console I never see the defaultapppool as disabled despite the fact that it shows as disabled in the logs.

I have been playing around with timeouts but but never seem to get something right.

My current theories are:

1) PHP freaks out with many users ( Windows, IIS ) and can't handle it

2) the crashing of the .dll causes troubles when many users are online

3) php+iis compatibility is not that good in high volumes, though I don't believe 15k/day are too many users. I should note though, that most requests take anywhere from 50-300 milliseconds to complete.

php version is 5.3.19 installed via WebPI, windows version is windows 2008 R2 64bit.

For some weird reason, notepad++ shows the query strings of the abandoned/disabled queries, in httperr log in a non-copyable hex form ( the querystrings are UTF8 - greek ) while in the normal logs, the query strings are both visible and copyable. screenshot provided below.

I'm also providing a second screenshot with current settings

HTTPERR logfile...errors start with connection dropped and then a bit later with connection abandoned http://img32.imageshack.us/img32/3796/9nkv.jpg

in the second screenshot are my current settings: 1) enabled php extensions, 2) defaultapppool ( the pool the website runs on ) settings 3) php fastcgi settings and 4) php runtime limits. http://img34.imageshack.us/img34/2531/o6d1.jpg

my last setting tweaking today was to auto-recycle the defaultapppool every 3 minutes and to disable dynamic content compression. Will see how that will go .

If anyone has any hints/ideas on the solution I would appreciate that alot!

Thank you in advance.

like image 738
MirrorMirror Avatar asked Nov 01 '22 13:11

MirrorMirror


1 Answers

Could I suggest going to 5.3.27 (the final release of 5.3) and see if that fixes it? There are too many crash bugs that were fixed between 20 and 27 to count. Might be the obvious solution but worth a shot.

like image 111
Machavity Avatar answered Nov 15 '22 04:11

Machavity