469,576 Members | 1,662 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,576 developers. It's quick & easy.

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

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
Feb 4 '06 #1
3 1480
tbone wrote:

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.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Feb 4 '06 #2
Bob, thanks for the info.

On Sat, 4 Feb 2006 10:54:26 -0500, "Bob Barrows [MVP]"
<re******@NOyahoo.SPAMcom> wrote:
tbone wrote:

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.

Feb 5 '06 #3
http://blogs.msdn.com/david.wang/arc...s_on_IIS6.aspx

Thanks to David Wang for what appears to be the explanation.
Feb 9 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by The Jetman | last post: by
7 posts views Thread by Lynn | last post: by
1 post views Thread by Bob Weisenburger | last post: by
5 posts views Thread by Stephen Lamb | last post: by
4 posts views Thread by FB's .NET Dev PC | last post: by
13 posts views Thread by Thomas Mlynarczyk | last post: by
1 post views Thread by theands | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.