ASP.NET Development Server concurrent processing doesn't work
Asked Answered
B

3

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?

Bedroom answered 27/1, 2012 at 15:55 Comment(0)
H
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

Herring answered 27/1, 2012 at 16:8 Comment(0)
I
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.

Itinerancy answered 27/1, 2012 at 16:8 Comment(2)
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.Itinerancy
yes you offered a nice angle of view that shouldn't be punished but be rewarded...Phylogeny
A
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?

Affliction answered 18/2, 2013 at 9:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.