ASP.NET Development Server concurrency not working

I am trying to find out why ASP.NET Development Server is not processing requests at the same time.

So, I 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 twice, the answer takes 20 seconds. This means that the server executes requests one by one (and not simultaneously).

Following the tips in this section , I added EnableSessionState="false" to the page, but that doesn't seem to help.

Any ideas on how to make requests at the same time?

+6
source share
3 answers

The asp.net dev (cassini) server cannot handle multiple threads. Thus, it efficiently processes requests one at a time. Disconnecting a session does not really affect this.

It is really easy for limited single-user testing of a web application.

I would recommend that you reset cassini and install IIS Express or just move on to the full implementation of IIS.

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

+7
source

IIS on XP does not allow many concurrent connections (I think it is 10). If you work in this environment, this is probably why you are experiencing it (in addition to these two requests, you have requests for files with links, plus you can receive more requests than you think you are on this particular page).

I am not sure if the VS-embedded server has similar limitations.

0
source

If you use ASP.NET MVC without disabling SessionState (which would be the default), your requests will be automatically serialized, so if you check the race conditions with a random value of Thread.Sleep() , then request B will never end before request A even if time has slept less.

ASP.NET MVC and Ajax concurrent requests?

0
source

Source: https://habr.com/ru/post/907041/


All Articles