views:

61

answers:

3

Good day!

I've found interesting behaviour for both LAMP stack and ASP.NET.

The scenario:

There is page performing task in 2-3 minutes (making HttpWebRequest for ASP.NET and curl for PHP). While this page is processed all other requests to this virtual host from the same browser are not processed (even if I use different browsers from one machine). I use two pages written in PHP and C#.

I've tested with Apache+PHP in both mod_php and fast_cgi modes on Windows and Debian. For ASP.NET I use IIS6 (with dedicated app pool for this site and with default app pool) and IIS7 in integrated mode.

I know that it is better to use async calls for such things, but I'm just curious why single page blocks the entire site and not only the thread processing the request?

Thanks in advance!

A: 

I don't think it's blocking the site; I would suspect that the open connection is blocking the client from making more requests. Have you proven that other machines can't use the site while your long-running request is in progress?

Dan Puzey
I have trying to use another browser (not another window, another program) from the same machine. As far as I understand things this should create another processing thread for new requests.
artvolk
Except not if your local machine already has an open connection to the same server on the same port. I repeat my question: have you proven that *other machines* can't use the site? I don't think you've proven that the server is blocked yet.
Dan Puzey
I have tested from other PC standing near. While my page is performing HttpWebRequest, the site is blocked for this PC too.Both PCs are behind the same NAT box
artvolk
A: 

If you only see a single request coming to the app the only thing I can think of is a global lock somewhere in the pipeline.

The lock can be explicit (you wrote the lock statement) or implicit. If you can see several requests - it can be due to the thread pool exhaustion.

Keep in mind that in addition to the cap on the number of threads used to process incoming web requests there is a separate cap on the number of simultaneous outgoing web requests through HttpWebRequest and by default this limit is very low - if I remember correctly 2 per CPU. I do not remember the name of the setting in the web.config, but will try to look it up.

In any case posting code would give us a better chance to assist you

mfeingold
Thank you for the response, do you mean this:http://support.microsoft.com/kb/821268But what about PHP and Apache? Why the same behaviour?..
artvolk
A: 

I've definitely noticed this behavior while debugging ASP.NET applications, but I have always just assumed it was a debug config issue. Are you building everything in release mode and have debugging turned off in your web.config?

Bryan
Yes, I have debugging turning off.
artvolk