Production server does not manage multiple request at time [Answered]RSS

4 replies

Last post Aug 27, 2011 10:58 AM by abellix

  • Production server does not manage multiple request at time

    Aug 26, 2011 06:57 AM|abellix|LINK

    In DEV environment I run this action in an ASP.NET MVC 2 application:

    public ActionResult Index()
    {
    logger.Warn("Operation START");
    Thread.Sleep(10000);
    logger.Warn("Operation END");
    return View();
    }

    If I call 3 time this action simulating 3 different user I get this:

    20:33:21 GMT | Operation START
    20:33:21 GMT | Operation START
    20:33:21 GMT | Operation START
    20:33:31 GMT | Operation END
    20:33:31 GMT | Operation END
    20:33:31 GMT | Operation END

    So the operations are executed in parallel.
    If i do the same in production environment I get this:

    20:38:21 GMT | Operation START
    20:38:31 GMT | Operation END
    20:38:31 GMT | Operation START
    20:38:41 GMT | Operation END
    20:38:41 GMT | Operation START
    20:38:51 GMT | Operation END

    Each request waits that the previous is over to get executed. Same application, different behavior.
    Also the Web.Config is the same. I am quite sure it's something related to IIS (v7) or specific to the web server.

    Has someone a clue for this issue? Thank you

    IIS7 .net 4 asp.net mvc 2

  • Re: Production server does not manage multiple request at time

    Aug 26, 2011 09:54 AM|abellix|LINK

    As additional clue: looking at Performance Monitor, it looks like in the PROD server the requests are pooled in the order they're received, but their execution is sequential.
    Why my server is not be able to multi-thread???
  • Re: Production server does not manage multiple request at time

    Aug 26, 2011 12:37 PM|abellix|LINK

    Maybe something related to the target platform? I am releasing to Any CPU and looks like the Enable 32 bit flag in IIS does something...
  • Re: Production server does not manage multiple request at time - Enable 32-Bit Applications shoul...

    Aug 26, 2011 01:22 PM|abellix|LINK

    I deployed my application forcing 64bit. Same issue than before. Requests are managed sequentially
  • Re: Production server does not manage multiple request at time

    Aug 27, 2011 10:58 AM|abellix|LINK

    Here the solution.

    http://msdn.microsoft.com/en-us/library/ms178581.aspx

    At the bottom of the page. It says:

    Concurrent Requests and Session State

    Access to ASP.NET session state is exclusive per session, which means that if two different users make concurrent requests, access to each separate session is granted concurrently. However, if two concurrent requests are made for the same session (by using the same SessionID value), the first request gets exclusive access to the session information. The second request executes only after the first request is finished. (The second session can also get access if the exclusive lock on the information is freed because the first request exceeds the lock time-out.) If the EnableSessionState value in the @ Page directive is set to ReadOnly, a request for the read-only session information does not result in an exclusive lock on the session data. However, read-only requests for session data might still have to wait for a lock set by a read-write request for session data to clear.

    asp.net session