6

I'm trying to find out why ASP.NET Development Server is not processing the requests concurrently.

So I've created a simple aspx page with the following code:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

System.Threading.Thread.Sleep(10000)

End Sub

If I open the page two times, the response takes 20 seconds. That means, the server executes requests one by one (not concurrently).

Following advice provided in this topic, I've added EnableSessionState="false" to the page, but that doesn't seem to help.

Any ideas how to make the requests process concurrently?

Community
  • 1
  • 1
SharpAffair
  • 5,558
  • 13
  • 78
  • 158

3 Answers3

7

The asp.net dev server (cassini) cannot handle multiple threads. So it effectively processes requests one at a time. Turning session off really won't impact this.

It's really just for limited single user testing of a web app.

I'd recommend you dump cassini and install IIS Express or just go to the full IIS implementation.

A little reading: ASP.NET Dev Server (Cassini), IIS Express and multiple threads

Community
  • 1
  • 1
NotMe
  • 87,343
  • 27
  • 171
  • 245
0

If you're using ASP.NET MVC without disabling SessionState (which by default you would be) your requests will be automatially serialized - so if you're checking for race conditions with a random Thread.Sleep() value then Request B will never complete before Request A even if the time slept for is less.

ASP.NET MVC and Ajax, concurrent requests?

Community
  • 1
  • 1
Simon_Weaver
  • 140,023
  • 84
  • 646
  • 689
0

IIS on XP doesn't allow that many concurrent connections (I think it's 10). If you're developing in that environment, that may be why you're experiencing that (besides those 2 requests, you have requests for referenced files taking place, plus you may be issuing more requests than you think you are for that particular page).

I'm not sure if VS built-in server has similar limitations.

  • I don't understand why this answer was viewed so off-topic to make somebody downvote it. I think it was relevant, and even though it doesn't really answer the question (vague as it is), it shouldn't be punished. If anything, I should get "thanks, anyway". Well, thanks, anyway, to whoever did it. –  Jan 27 '12 at 20:19
  • yes you offered a nice angle of view that shouldn't be punished but be rewarded... – Lenn Dolling Sep 09 '12 at 01:29