HTTP 503 - Service Unavailable intermittently on IIS 6 because of miss configuration.

We had an ASP.net1.1 application running on IIS 6 and it is giving intermittently “page can't be displayed in IE” Actually it was 503 Service unavailable  and it get resolved by IISreset.

And is lgging in Event logs : Event ID 1078 - State server has closed an expired TCP/IP connection. The ip address of the client is 127.0.0.1. the expired read operation began at date and time

 Cause :  Miss configurations As below:

Machine.config: <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" stateNetworkTimeout="10" sqlConnectionString="data source=127.0.0.1;Integrated Security=SSPI" cookieless="false" timeout="20"/>

Web.config: < sessionState mode="StateServer" stateNetworkTimeout="10" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=localhost;user id=sa;password=" cookieless="false" timeout="20"/>
    

Resolution

  •  Used InProc to save session data locally. Then we changed both to: <sessionState mode="InProc" cookieless="false" timeout="20"/>
  • Then we followed this article https://support.microsoft.com/kb/308097 to enable socket time as below, just if you want to use stateserver again.

Steps:

1. Stop the ASP.NET state server service.

2. Click Start, click Run, type Regedt32.exe, and then click OK to start Registry Editor.

3. Locate the following key in the registry: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters

4. Add a DWORD value that is named SocketTimeout. Set a positive integer to represent the new TCP/IP timeout in seconds.

5. Quit Registry Editor. 6. Restart the ASP.NET state server service