What happens in BeginProcessRequest()?

后端 未结 4 923
后悔当初
后悔当初 2020-11-28 20:33

We are using NewRelic to provide server-side application traces.

We have noticed that some of our applications consistently spend about 100ms in the method Sys

4条回答
  •  天涯浪人
    2020-11-28 21:11

    If you want to enable a certain controller to process requests in parallel from a single user, you can use an attribute named SessionState that was introduced in MVC since version 3. It’s not necessary to use a session-less controller in order to achieve parallelism, the Ready-only option of the SessionStateBehavior will let you pass security checks you may have implemented based on Session data.

    [SessionState(System.Web.SessionState.SessionStateBehavior.ReadOnly)]
    [OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")]
    public class ParallelController : Controller
    {
        ...
    }
    

    I also had delays in System.Web.Mvc.MvcHandler.BeginProcessRequest(), when try to do a few long running actions and I saw it in NewRelic. This attributes have solved problem and gave ability to handle actions parallel for this controller.

提交回复
热议问题