<div>I have a web application developed in .net 2.0 and hosted in IIS7 on a Win2008 server, using its own application pool and integrated pipelines. Web pages on average take less than 2 seconds
to return response but sometimes it takes much longer, 30 to 90 seconds. The time appears to be taken server-side (between BeginRequest and EndRequest) and the web page is not different from those taking less than 2 seconds.</div> <div> </div> <div>I collected IIS failed request trace logs for pages running over 30 seconds to find some of the worst pages and found some situations where the sessionstatemodule takes a significant amount of time.
Our application does not use session state so this appears especially odd. Reviewing pages taking less than 2 seconds, zero time is spent in the sessionstatemodule events. Looking at some of the long-running pages, I see the sessionstatemodule events taking the
bulk of the time server-side. How does this happen and what can be done to stop this behavior?</div> <div> </div> <div>Here's a snippet of a trace log illustrating a page spending 26 seconds
in the sessionstatemodule. I'm happy to provide the entire trace log if that is helpful to diagnose this issue.</div> <div> </div> <div>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="ASPNET" Guid="{AFF081FE-0247-4275-9C4E-021F3DC1DA35}"/>
<EventID>0</EventID>
<Version>0</Version>
<Level>5</Level>
<Opcode>10</Opcode>
<Keywords>0x2</Keywords>
<TimeCreated SystemTime="2010-08-31T23:26:55.734Z"/>
<Correlation ActivityID="{00000000-0000-0000-A350-0080000000B8}"/>
<Execution ProcessID="4424" ThreadID="4716"/>
<Computer>APTPRODWEB07</Computer>
</System>
<EventData>
<Data Name="ConnID">0</Data>
<Data Name="Context ID">{00000000-0000-0000-A350-0080000000B8}</Data>
<Data Name="Data1">System.Web.SessionState.SessionStateModule</Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>AspNetPipelineEnter</Opcode>
<Keywords>
<Keyword>Module</Keyword>
</Keywords>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{06A01367-79D3-4594-8EB3-C721603C4679}</EventGuid>
</ExtendedTracingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="ASPNET" Guid="{AFF081FE-0247-4275-9C4E-021F3DC1DA35}"/>
<EventID>0</EventID>
<Version>0</Version>
<Level>4</Level>
<Opcode>42</Opcode>
<Keywords>0x8</Keywords>
<TimeCreated SystemTime="2010-08-31T23:26:55.734Z"/>
<Correlation ActivityID="{00000000-0000-0000-A350-0080000000B8}"/>
<Execution ProcessID="4424" ThreadID="4716"/>
<Computer>APTPRODWEB07</Computer>
</System>
<EventData>
<Data Name="ConnID">0</Data>
<Data Name="Context ID">{00000000-0000-0000-A350-0080000000B8}</Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>AspNetSessionDataBegin</Opcode>
<Keywords>
<Keyword>AppServices</Keyword>
</Keywords>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{06A01367-79D3-4594-8EB3-C721603C4679}</EventGuid>
</ExtendedTracingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="ASPNET" Guid="{AFF081FE-0247-4275-9C4E-021F3DC1DA35}"/>
<EventID>0</EventID>
<Version>0</Version>
<Level>4</Level>
<Opcode>43</Opcode>
<Keywords>0x8</Keywords>
<TimeCreated SystemTime="2010-08-31T23:27:21.827Z"/>
<Correlation ActivityID="{00000000-0000-0000-A350-0080000000B8}"/>
<Execution ProcessID="4424" ThreadID="4716"/>
<Computer>APTPRODWEB07</Computer>
</System>
<EventData>
<Data Name="ConnID">0</Data>
<Data Name="Context ID">{00000000-0000-0000-A350-0080000000B8}</Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>AspNetSessionDataEnd</Opcode>
<Keywords>
<Keyword>AppServices</Keyword>
</Keywords>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{06A01367-79D3-4594-8EB3-C721603C4679}</EventGuid>
</ExtendedTracingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="ASPNET" Guid="{AFF081FE-0247-4275-9C4E-021F3DC1DA35}"/>
<EventID>0</EventID>
<Version>0</Version>
<Level>5</Level>
<Opcode>11</Opcode>
<Keywords>0x2</Keywords>
<TimeCreated SystemTime="2010-08-31T23:27:21.827Z"/>
<Correlation ActivityID="{00000000-0000-0000-A350-0080000000B8}"/>
<Execution ProcessID="4424" ThreadID="4716"/>
<Computer>APTPRODWEB07</Computer>
</System>
<EventData>
<Data Name="ConnID">0</Data>
<Data Name="Context ID">{00000000-0000-0000-A350-0080000000B8}</Data>
<Data Name="Data1">System.Web.SessionState.SessionStateModule</Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>AspNetPipelineLeave</Opcode>
<Keywords>
<Keyword>Module</Keyword>
</Keywords>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{06A01367-79D3-4594-8EB3-C721603C4679}</EventGuid>
</ExtendedTracingInfo>
</Event></div>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="ASPNET" Guid="{AFF081FE-0247-4275-9C4E-021F3DC1DA35}"/>
<EventID>0</EventID>
<Version>0</Version>
<Level>5</Level>
<Opcode>10</Opcode>
<Keywords>0x2</Keywords>
<TimeCreated SystemTime="2010-08-31T23:26:55.734Z"/>
<Correlation ActivityID="{00000000-0000-0000-A350-0080000000B8}"/>
<Execution ProcessID="4424" ThreadID="4716"/>
<Computer>APTPRODWEB07</Computer>
</System>
<EventData>
<Data Name="ConnID">0</Data>
<Data Name="Context ID">{00000000-0000-0000-A350-0080000000B8}</Data>
<Data Name="Data1">System.Web.SessionState.SessionStateModule</Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>AspNetPipelineEnter</Opcode>
<Keywords>
<Keyword>Module</Keyword>
</Keywords>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{06A01367-79D3-4594-8EB3-C721603C4679}</EventGuid>
</ExtendedTracingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="ASPNET" Guid="{AFF081FE-0247-4275-9C4E-021F3DC1DA35}"/>
<EventID>0</EventID>
<Version>0</Version>
<Level>4</Level>
<Opcode>42</Opcode>
<Keywords>0x8</Keywords>
<TimeCreated SystemTime="2010-08-31T23:26:55.734Z"/>
<Correlation ActivityID="{00000000-0000-0000-A350-0080000000B8}"/>
<Execution ProcessID="4424" ThreadID="4716"/>
<Computer>APTPRODWEB07</Computer>
</System>
<EventData>
<Data Name="ConnID">0</Data>
<Data Name="Context ID">{00000000-0000-0000-A350-0080000000B8}</Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>AspNetSessionDataBegin</Opcode>
<Keywords>
<Keyword>AppServices</Keyword>
</Keywords>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{06A01367-79D3-4594-8EB3-C721603C4679}</EventGuid>
</ExtendedTracingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="ASPNET" Guid="{AFF081FE-0247-4275-9C4E-021F3DC1DA35}"/>
<EventID>0</EventID>
<Version>0</Version>
<Level>4</Level>
<Opcode>43</Opcode>
<Keywords>0x8</Keywords>
<TimeCreated SystemTime="2010-08-31T23:27:21.827Z"/>
<Correlation ActivityID="{00000000-0000-0000-A350-0080000000B8}"/>
<Execution ProcessID="4424" ThreadID="4716"/>
<Computer>APTPRODWEB07</Computer>
</System>
<EventData>
<Data Name="ConnID">0</Data>
<Data Name="Context ID">{00000000-0000-0000-A350-0080000000B8}</Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>AspNetSessionDataEnd</Opcode>
<Keywords>
<Keyword>AppServices</Keyword>
</Keywords>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{06A01367-79D3-4594-8EB3-C721603C4679}</EventGuid>
</ExtendedTracingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="ASPNET" Guid="{AFF081FE-0247-4275-9C4E-021F3DC1DA35}"/>
<EventID>0</EventID>
<Version>0</Version>
<Level>5</Level>
<Opcode>11</Opcode>
<Keywords>0x2</Keywords>
<TimeCreated SystemTime="2010-08-31T23:27:21.827Z"/>
<Correlation ActivityID="{00000000-0000-0000-A350-0080000000B8}"/>
<Execution ProcessID="4424" ThreadID="4716"/>
<Computer>APTPRODWEB07</Computer>
</System>
<EventData>
<Data Name="ConnID">0</Data>
<Data Name="Context ID">{00000000-0000-0000-A350-0080000000B8}</Data>
<Data Name="Data1">System.Web.SessionState.SessionStateModule</Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>AspNetPipelineLeave</Opcode>
<Keywords>
<Keyword>Module</Keyword>
</Keywords>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{06A01367-79D3-4594-8EB3-C721603C4679}</EventGuid>
</ExtendedTracingInfo>
</Event></div>