0

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?

vsevolod
  • 155
  • 2
  • 10
  • Perhaps the browser is the bottleneck? http://stackoverflow.com/questions/985431/max-parallel-http-connections-in-a-browser – Emil Lundin Nov 24 '14 at 10:12
  • As much as I understand the browser will load pictures in "batches" which size can't be more then max allowed connections. If overall number of requests is more then 6(for Chrome) other requests become stalled, until connection becomes available. But this "slow" requests are spending time in TTFB state. Also I mentioned in my question that this requests are hanging between PostMapRequestHandler and AcquireRequestState events, which confirms that it is a server problem. – vsevolod Nov 24 '14 at 10:50

1 Answers1

0

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.

Brian
  • 1