dbo.TempGetStateItemExclusive3 called repeatedly

天大地大妈咪最大 提交于 2019-12-02 22:09:19
Adrian M

We've faced a similar problem having the following configuration:

  • IIS 7.5
  • .NET Framework 4.0
  • Windows 2008 (on both the IIS and the DB server)
  • sessions managed by the ASPState database

The problem was that sometimes some of the sessions remained locked into the ASPState database, resulting in hundreds of calls per second to dbo.TempGetStateItemExclusive3 for each of the locked sessions.

The CPU on the IIS server would eventually go up with the number of locked sessions. A temporary solution was to recycle the application pool.

Going further and enabling the Tracing on the IIS server(s) and then analyzing the traces we noticed that whenever there was a problem (i.e. network connectivity problem that caused a 500 Internal server error) in the EXECUTE_REQUEST_HANDLER module, the next module which is RELEASE_REQUEST_STATE (and should unlock the session) was not be executed. Thus the session remained locked.

It turned up to be a bug from IIS and we fixed it by changing the value of the uploadReadAheadSize to 0 in the web.config:

<system.webServer>
  <serverRuntime uploadReadAheadSize="0" />
</system.webServer>

The UploadReadAheadSize property establishes the number of bytes a Web server will read into a buffer and pass to an ISAPI extension. This occurs once per client request.

See also: ManagedPipelineHandler for an AJAX POST crashes if an IE9 user navigates away from a page while that call was in progress

Stephen Pope

Looks like a SQL issue rather than a Sitecore one, possibly related to sessions not being cleared up. I'm not a DBA but is the the SQL Agent enabled ? Is your production SQL server at a different service pack/patch level to the other environments (this article mentions some old hotfixes for a similar issue)?

Some links for investigation, until maybe someone can answer this more specifically ! You might want to include some info on what versions of SQL you are using.

http://jerschneid.blogspot.co.uk/2010/01/aspnet-sql-server-requests-timing-out.html

https://www.simple-talk.com/sql/sql-tools/how-to-identify-blocking-problems-with-sql-profiler/

Paul George

To explore the notion that is could be something in the application setup within IIS, you could dump out the config of your site using web deploy (msdeploy). Then run a compare on the output between the box exhibiting the problem and another that doesn't.

Something like this will output to console

msdeploy –verb:dump –source:appHostConfig="Default Web Site"

or as XML

msdeploy –verb:dump –source:appHostConfig="Default Web Site" -xml

See http://technet.microsoft.com/en-us/library/dd569101(v=ws.10).aspx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!