ASP startup/shutdown questions - this shouldn't be happening... (MVPs?)

T

tbone

In trying to improve the throughput of a classic ASP app I wrote a few
years ago, I added monitoring to the application and session start and
end methods. I'm counting the total number of sessions and the high
water mark. The results are puzzling to me.

In Application_OnStart, I clear the current and highwater session
counts, and write an app startup event to my app log file (a text
file). In Application_OnEnd, I write an app shutdown complete event to
the log. In Session_OnStart, I bump the current count (an app
variable), and write a session start event with the current and
maximum count to the log. In Session_OnEnd, I decrement the current
cound and write a session shutdown event with the current and maximum
count to the log. All app log writing and session count calculations
are done with Application.Lock in effect.

Observations and questions:

1. In the log file, it appears that the ASP application is being
shutdown and restarted almost daily. I see startup events logged as
well as shutdown events. The hosting company swears that neither the
machine (shared server) nor IIS nor the application is being
restarted. Is there any other way that the Application_OnStart and
_OnEnd methods might be invoked that would explain this?

2. I found in the log file that apparently one invocation of the app
was being shutdown while a new one was being started. The app startup
event for the new run was logged before the Shutdown Complete event
was logged (in the same file) for the old run. The session startup
events in the app log are interspersed with the session shutdown
events. Each event includes the current number of sessions and the
high water mark, so I can see the session count going down with the
shutdown events, while a different session count is going up with the
startup events. How is this possible?

Thanks
tbone
 
B

Bob Barrows [MVP]

tbone said:
1. In the log file, it appears that the ASP application is being
shutdown and restarted almost daily. I see startup events logged as
well as shutdown events. The hosting company swears that neither the
machine (shared server) nor IIS nor the application is being
restarted. Is there any other way that the Application_OnStart and
_OnEnd methods might be invoked that would explain this?
If the global.asa file is modified, the application will restart.
2. I found in the log file that apparently one invocation of the app
was being shutdown while a new one was being started. The app startup
event for the new run was logged before the Shutdown Complete event
was logged (in the same file) for the old run. The session startup
events in the app log are interspersed with the session shutdown
events. Each event includes the current number of sessions and the
high water mark, so I can see the session count going down with the
shutdown events, while a different session count is going up with the
startup events. How is this possible?

One thing: you can't always depend on session_onend firing when you expect
it to:
http://www.aspfaq.com/show.asp?id=2078

You may want to direct these questions to the .inetserver.iis group.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top