473,387 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

The state server has closed an expired TCP/IP connection.

The 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

11/16/2007 14:31:49.

This one has been bothering me for quite some time... there didn't seem
to be any real solutions for this or they didn't seem to apply.
Microsoft discusses this issue in the Knowledge base, but it seems to
only happen under very heavy load, and their resolution didn't fix my
problem.

Finally, I figured it out, and I wanted to pass my knowledge on to the
masses.

The biggest clue was that sometimes it would start throwing these state
server errors in the event log at times when there was almost no
traffic on the website. This seemed to indicate to me that microsofts
KB article was dead wrong since they state that this can occur during
heavy load.

The culprit ended up being a "Memory Leak". (I use quotes because it
was not a leak in the traditional sense... its just that objects that I
thought should be GC'd were not getting GC'd)

If you have this issue, take a look at the memory usage on the box.
Does it seem to only go up and rarely go down... i.e. More is being
used than collected over time. I noticed that it went up rather
consistently throughout the day, and not nearly enough of it seemed to
be freed during a GC.

At about 900 Mb, the garbage collector started doing a Gen 2 every
second. A gen 2 on 900 Mb tends to be very CPU intensive, and would max
out our 4 processors to 100% for about a second. Eventually we had it
set up to recycle the app when it got that high, but that wasn't a real
solution.

Do you have many complicated object graphs that tend to be rather large
that are being stored in InProc session or in the ASP.NET cache? How
about web controls that have custom events which are handled by methods
in other web controls? These two were my biggest problems... for the
web controls, I simply unregistered the event handlers in the unload
event of the control. That helped a ton. In ASP.NET, I've found the
best way to write the pages is to load and release, keep as little as
possible in cache... try to use the ViewState rather than
Session/Cache... And be wary of how complicated your object graphs are
getting. Try re-querying the database forg grid paging, rather than
keeping all of the paged data in memory.

I ended up having to purchase the ANTS profiler to see what wasn't
getting relased in a timely fashion, and that helped quite a bit...
That with the Microsoft Application Test Center tool, I was able to fix
my problem... and NOW (finally!) no more of this state server TCP/IP
connection issue.

I hope that this helps somebody in the future
Josh Norris
Senior Application Developer
Henderson Engineers, Inc

Jun 28 '06 #1
0 1934

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: David Morgan | last post by:
Hello In my ASP page I am trying to ascertain whether a randomly generated ID starts with certain characters that are not allowed or has been used before. When the SQL statement for latter is...
4
by: DreJoh | last post by:
I've read many articles on the subject and the majority of them give the same solution that's in article 821625 on the MSDN website. I'm using the following code and when a the client disconnects...
8
by: Claire | last post by:
I'm trying to debug my network application ie I want to check my error handling when the connection is broken. Im using 127.0.0.1 as the connection address. Unfortunately, the client socket goes...
0
by: LeyvaOne | last post by:
Has anyone had an issue wher they receive the "The state server has closed an expired TCP/IP connection" event log message? We have a load-balanced server environment running on Windows 2003. The 2...
3
by: bennett | last post by:
In the web.config file for my application, in the <sessionState> section I have set timeout="120" (in minutes), but session state variables in my application seem to be expiring in about 5 minutes....
3
by: Nils Magnus Englund | last post by:
Hi, I've made a HttpModule which deals with user authentication. On the first request in a users session, it fetches data from a SQL Server using the following code: using (SqlConnection...
0
by: GarDavis | last post by:
We just installed Windows Server 2003 SP1 and also Framework 2.0 and now are seeing this message in the event log every minute or so: The state server has closed an expired TCP/IP connection. The...
0
by: dm3281 | last post by:
Hello -- I'm getting the messages in my state server's event log (web farm) as displayed on this blog http://myblog4fun.com/dmohorn/archive/2006/09/28/26.aspx. I'm being told that other...
0
by: dm3281 | last post by:
Hello -- I'm getting the messages in my state server's event log (web farm) as displayed on this blog http://myblog4fun.com/dmohorn/archive/2006/09/28/26.aspx. I'm being told that other...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.