I just discovered why all ASP.Net websites are slow, and I am trying to work out what to do about it

前端 未结 10 758
情话喂你
情话喂你 2020-11-22 07:53

I just discovered that every request in an ASP.Net web application gets a Session lock at the beginning of a request, and then releases it at the end of the request!

10条回答
  •  孤独总比滥情好
    2020-11-22 08:17

    OK, so big Props to Joel Muller for all his input. My ultimate solution was to use the Custom SessionStateModule detailed at the end of this MSDN article:

    http://msdn.microsoft.com/en-us/library/system.web.sessionstate.sessionstateutility.aspx

    This was:

    • Very quick to implement (actually seemed easier than going the provider route)
    • Used a lot of the standard ASP.Net session handling out of the box (via the SessionStateUtility class)

    This has made a HUGE difference to the feeling of "snapiness" to our application. I still can't believe the custom implementation of ASP.Net Session locks the session for the whole request. This adds such a huge amount of sluggishness to websites. Judging from the amount of online research I had to do (and conversations with several really experienced ASP.Net developers), a lot of people have experienced this issue, but very few people have ever got to the bottom of the cause. Maybe I will write a letter to Scott Gu...

    I hope this helps a few people out there!

提交回复
热议问题