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

Discussion in 'ASP General' started by tbone, Feb 4, 2006.

  1. tbone

    tbone Guest

    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
     
    tbone, Feb 4, 2006
    #1
    1. Advertising

  2. 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"
     
    Bob Barrows [MVP], Feb 4, 2006
    #2
    1. Advertising

  3. tbone

    tbone Guest

    Bob, thanks for the info.

    On Sat, 4 Feb 2006 10:54:26 -0500, "Bob Barrows [MVP]"
    <> 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.
     
    tbone, Feb 5, 2006
    #3
  4. tbone

    tbone Guest

    tbone, Feb 9, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Colin Young
    Replies:
    1
    Views:
    494
    Kathy Burke
    Jun 27, 2003
  2. Justin SB
    Replies:
    2
    Views:
    409
    David Browne
    Jun 27, 2003
  3. Todd Thompson
    Replies:
    1
    Views:
    496
    Kathy Burke
    Jun 27, 2003
  4. Rajesh Huria

    Startup & Shutdown

    Rajesh Huria, May 27, 2011, in forum: Ruby
    Replies:
    4
    Views:
    531
    Kouhei Sutou
    May 28, 2011
  5. Larry
    Replies:
    9
    Views:
    302
    samwyse
    Jul 20, 2005
Loading...

Share This Page