Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > ASP startup/shutdown questions - this shouldn't be happening... (MVPs?)

Reply
Thread Tools

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

 
 
tbone
Guest
Posts: n/a
 
      02-04-2006
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
 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      02-04-2006
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"


 
Reply With Quote
 
 
 
 
tbone
Guest
Posts: n/a
 
      02-05-2006
Bob, thanks for the info.

On Sat, 4 Feb 2006 10:54:26 -0500, "Bob Barrows [MVP]"
<(E-Mail Removed)> 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.

 
Reply With Quote
 
tbone
Guest
Posts: n/a
 
      02-09-2006
http://blogs.msdn.com/david.wang/arc...s_on_IIS6.aspx

Thanks to David Wang for what appears to be the explanation.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP Interview Questions ASP Interview Questions reema ASP General 0 08-26-2008 11:57 AM
Malloc and free questions - learner questions pkirk25 C Programming 50 10-04-2006 02:22 PM
Questions on Canon 300D and etc. questions regarding digital photography Progressiveabsolution Digital Photography 12 03-24-2005 05:18 PM
Newbie questions - Couple of VC++ questions regarding dlls and VB6 Ali Syed C Programming 3 10-13-2004 10:15 PM
Re: Questions....questions....questions Patrick Michael A+ Certification 0 06-16-2004 04:53 PM



Advertisments