Web App Blocked While Processing Another Web App on Sharing Same Session

Web app blocked while processing another web app on sharing same session

 the session is getting shared across the two web apps

If the session is shared across the two web applications, then yes this is the reason. The session is lock the response.

To avoid this, on the huge upload information disable the session (only on the handler or on the page that make the upload).

Relative: Replacing ASP.Net's session entirely

Sharing Session between Asp.net Web Application and Asp.net Web API2 (Asp.net Web API2 is hosted under Asp.net Web App accessing one configuration)

I have found solution to my problem!

The session has to be enabled just before AcquireRequestState event i.e.

 protected void Application_PostMapRequestHandler(object sender, EventArgs e)
{
System.Web.HttpContext.Current.SetSessionStateBehavior(System.Web.SessionState.SessionStateBehavior.Required);
}

ASMX Web Service Blocked by Sessions

Yes, like anything else that's using session state, the session state module is going to block the request from going any further down the pipeline (i.e. executing your ASMX web method) until it can aquire the lock to the session. Session state is the enemy of concurrency, avoid it at all costs.

File upload and result pooling kills ASP.NET web app

I will say to you to double check the pages that take long time to proceed a work, or the pages that download or upload files, and disable the session on this pages. If this is not possible, then you may need to write a totally custom way to handle the session.

Why, because session is locks everything until the page fully return.

You can read relative to session and to this issue:

call aspx page to return an image randomly slow

ASP.NET Server does not process pages asynchronously

Trying to make Web Method Asynchronous

Web app blocked while processing another web app on sharing same session  

What perfmon counters are useful for identifying ASP.NET bottlenecks?  

Replacing ASP.Net's session entirely  

Why don't ASP.Net handlers support session by default

Its because the session is block the asynchronous operations, and the handle is usually used for long time operations, like the making and download of a file - if you keep the session on long time operation you block the rest of your pages.

Also the handle is made with the idea of the minimum required to get a response.

About the session lock:

Web app blocked while processing another web app on sharing same session

jQuery Ajax calls to web service seem to be synchronous

ASP.NET Server does not process pages asynchronously

Replacing ASP.Net's session entirely

Displaying progress for a long running process

This behavior is because the session is lock the entire process, and it locks and the rest of your users when you make backup.

Find some other place to store the process, other than the session. If you pool is running only with one application you may try to store it on a static variable, if you have web garden the other solution is to store that variable in a database, or on a xml file with other variables.

Also you need to run the backup from a page that have the session disabled !

About the session lock:

Web app blocked while processing another web app on sharing same session

jQuery Ajax calls to web service seem to be synchronous

ASP.NET Server does not process pages asynchronously

Replacing ASP.Net's session entirely

What actually happens in IIS when I load my URL?

This is called IIS Life Cycle

The fully details must be direct read from Microsoft and the creators of the IIS.

Is not the same for all IIS.

Life Cycle Overview for IIS 7.0

Life Cycle Overview for IIS 5.0 and 6.0

and there are more if you search on internet.

do they all get a separate instance of the app or do they use the same
one

If you use many pools for the same application (web garden) then they the request are split among the pools, or else one pool, one instance is take care to process the page.

The page can be processing from different threads, but there is a global lock on the session, so if you use the MS session the page will processing in serial (expect the one that did not use session)

Each pool is one instance that hold the static data, and is the same for all request from that pool. If you use two pools you have two different sets of static data.

Some questions about session lock:
Trying to make Web Method Asynchronous , Web app blocked while processing another web app on sharing same session



Related Topics



Leave a reply



Submit