ASP NET how to find where queries get queued

234 views Asked by At

I have ASP Net mvc 5 project, running on iis 8.5. There are a number of pages with images obtained from action like this:

<img src='/File/Contents/1'/>
<img src='/File/Contents/2'/>
...

About 90% of images are loaded rather fast (a few milliseconds each), but it takes very long to load last 10% (2-5 seconds each). I discovered that Contents action is performed with the same speed for all images and most of the time is spend between PostMapRequestHandler and AcquireRequestState events. I believe this requests are being queued somewhere, but I can't understand why is it happening. I know there is a limit in iis for max number of concurrent requests, but its default value for .net 4 is 5000 and I have about 100 images at most. Could someone tell me what is happening?

1

There are 1 answers

0
Brian On

Are you using HTTPSession? If you're using session, a R/W lock is held unless you explicity state that session is Read only. This is one of the major drawbacks of using session and can cause requests to queue up and appear to "hang" at AcquireRequestState.