G
Guest
I have an application which uses many instances of System.Threading.Timer.
This application is housed inside an HTTPAsyncHandler. When I receive certain
types of messages, I need to take an action 90 seconds later. For each
session I have a System.Threading.Timer created with infinite values for the
two intervals.. When one of these messages is received, I Change() the timer
so that the first interval is 90 seconds - the second is set to Infinite.
For the most part, the timers work just fine. However, I notice that rather
frequently (maybe 1 in 100), the timer takes much longer than 90 seconds to
fire - sometimes 100 sec, sometimes up to 150 sec. It looks like the timer
does fire - it's just late. This late firing is causing all sorts of other
problems with the app.
There does not seem to be a correlation with load - sometimes this happens
when there is only one active session, and nothing else is happening in the
meantime. Of course it only happens in production, not in development or
test. The production machine at the moment is a virtual server running under
win2003 web edition. SQL Server Express is also running on that server.
I've seen the KB article about Timers not firing in some circumstances under
load, but that appears to apply only to .NET 1.1. (I'm running 2.0).
Any suggestions as to what might be going on or how I can fix this?
This application is housed inside an HTTPAsyncHandler. When I receive certain
types of messages, I need to take an action 90 seconds later. For each
session I have a System.Threading.Timer created with infinite values for the
two intervals.. When one of these messages is received, I Change() the timer
so that the first interval is 90 seconds - the second is set to Infinite.
For the most part, the timers work just fine. However, I notice that rather
frequently (maybe 1 in 100), the timer takes much longer than 90 seconds to
fire - sometimes 100 sec, sometimes up to 150 sec. It looks like the timer
does fire - it's just late. This late firing is causing all sorts of other
problems with the app.
There does not seem to be a correlation with load - sometimes this happens
when there is only one active session, and nothing else is happening in the
meantime. Of course it only happens in production, not in development or
test. The production machine at the moment is a virtual server running under
win2003 web edition. SQL Server Express is also running on that server.
I've seen the KB article about Timers not firing in some circumstances under
load, but that appears to apply only to .NET 1.1. (I'm running 2.0).
Any suggestions as to what might be going on or how I can fix this?