A request to a long-running handler blocks all requests to other pageshttp://forums.asp.net/t/1798041.aspx/1?A+request+to+a+long+running+handler+blocks+all+requests+to+other+pagesSat, 28 Apr 2012 16:06:28 -040017980414956277http://forums.asp.net/p/1798041/4956277.aspx/1?A+request+to+a+long+running+handler+blocks+all+requests+to+other+pagesA request to a long-running handler blocks all requests to other pages <p>Hi</p> <p>I have a website which need to handle bandwidth throttling using user's informations (so if the user is registered, he will be given a higher priority while streaming). To do so, I have created a Handler which using an ID, writes to the Response object the bytes so that the maximum download rate is not exceeded. The handler needs to run until the download is complete or the user cancels the download. This causes the problem: while the handler is running, so the user is downloading someting, every other web page is not reacheable. How can I handle this? I already tried to create an asynchronous handler... nothing changed. I am running the website on a IIS 7 machine (Windows Data Center Edition)</p> 2012-04-28T14:46:39-04:004956281http://forums.asp.net/p/1798041/4956281.aspx/1?Re+A+request+to+a+long+running+handler+blocks+all+requests+to+other+pagesRe: A request to a long-running handler blocks all requests to other pages <p>I'll bet you're using Session state in your app, right?</p> <p>When requests come in, Session holds an exclusive lock so that other requests from the same session will not run in parallel and must run one after the other.</p> <p><a href="https://brockallen.wordpress.com/2012/04/07/think-twice-about-using-session-state/">Many more reasons why session is bad</a>.</p> 2012-04-28T14:49:23-04:004956283http://forums.asp.net/p/1798041/4956283.aspx/1?Re+A+request+to+a+long+running+handler+blocks+all+requests+to+other+pagesRe: A request to a long-running handler blocks all requests to other pages <p>I didn't try your solution yet, but my handler is using Session (because it implements IRequiresSessionState or something like that ;-)</p> <p>I'll try not using Session and let you know, thank you!</p> 2012-04-28T14:52:11-04:004956312http://forums.asp.net/p/1798041/4956312.aspx/1?Re+A+request+to+a+long+running+handler+blocks+all+requests+to+other+pagesRe: A request to a long-running handler blocks all requests to other pages <p>What about uploads? When I upload a file, all other requests must wait before being processed...</p> 2012-04-28T16:00:28-04:004956316http://forums.asp.net/p/1798041/4956316.aspx/1?Re+A+request+to+a+long+running+handler+blocks+all+requests+to+other+pagesRe: A request to a long-running handler blocks all requests to other pages <p></p> <blockquote><span class="icon-blockquote"></span> <h4>hkproj</h4> <p></p> <p>What about uploads? When I upload a file, all other requests must wait before being processed...</p> <p></p> </blockquote> <p></p> <p>If it's an HTTP request and the handler/page/controller is using session, then yep... that takes the lock.</p> <p></p> 2012-04-28T16:06:28-04:00