469,949 Members | 2,697 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Application_Start

asp.net 2/C#

I have noticed that during periods of inactivity on my website, the
Application_Start event is firing about every 40-45 minutes. Is this
normal? Shouldn't the app start once and remain running until I stop
it?

JP

Sep 27 '07 #1
18 1985
Not necessary, some worker processes might be set to recycle, or recycling
for lack of resources or failures.

Check application pool(s)
check World Wide Web Publishing Service
monitor your resources.
"Joey" <jo*********@topscene.comwrote in message
news:11*********************@57g2000hsv.googlegrou ps.com...
asp.net 2/C#

I have noticed that during periods of inactivity on my website, the
Application_Start event is firing about every 40-45 minutes. Is this
normal? Shouldn't the app start once and remain running until I stop
it?

JP

Sep 27 '07 #2
Check you event logs

"IfThenElse" <sq**********@hotmail.comwrote in message
news:e3**************@TK2MSFTNGP03.phx.gbl...
Not necessary, some worker processes might be set to recycle, or
recycling for lack of resources or failures.

Check application pool(s)
check World Wide Web Publishing Service
monitor your resources.
"Joey" <jo*********@topscene.comwrote in message
news:11*********************@57g2000hsv.googlegrou ps.com...
>asp.net 2/C#

I have noticed that during periods of inactivity on my website, the
Application_Start event is firing about every 40-45 minutes. Is this
normal? Shouldn't the app start once and remain running until I stop
it?

JP


Sep 27 '07 #3
"Joey" <jo*********@topscene.comwrote in message
news:11*********************@57g2000hsv.googlegrou ps.com...
I have noticed that during periods of inactivity on my website, the
Application_Start event is firing about every 40-45 minutes. Is this
normal? Shouldn't the app start once and remain running until I stop
it?
You don't start or stop the Application in this sense...

Application_Start fires when the first Session is created and
Application_End fires when the last Session ends.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 27 '07 #4
Mark,

Please define first Session and last Session

"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
"Joey" <jo*********@topscene.comwrote in message
news:11*********************@57g2000hsv.googlegrou ps.com...
>I have noticed that during periods of inactivity on my website, the
Application_Start event is firing about every 40-45 minutes. Is this
normal? Shouldn't the app start once and remain running until I stop
it?

You don't start or stop the Application in this sense...

Application_Start fires when the first Session is created and
Application_End fires when the last Session ends.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 27 '07 #5
"IfThenElse" <sq**********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Please define first Session and last Session
When a client browser first sends a Request to a web application running
under IIS, a Session is created...

If no other Sessions are in existence at that moment, Application_Start
fires.

When a Session dies, if no other Sessions are in existence at that moment,
Application_End fires.

--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 27 '07 #6
Mark,

So Joey's situation is normal then.

Thanks
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:uP**************@TK2MSFTNGP05.phx.gbl...
"IfThenElse" <sq**********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>Please define first Session and last Session

When a client browser first sends a Request to a web application running
under IIS, a Session is created...

If no other Sessions are in existence at that moment, Application_Start
fires.

When a Session dies, if no other Sessions are in existence at that moment,
Application_End fires.

--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 27 '07 #7
"IfThenElse" <sq**********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
So Joey's situation is normal then.
Completely.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 27 '07 #8
Joey wrote:
asp.net 2/C#

I have noticed that during periods of inactivity on my website, the
Application_Start event is firing about every 40-45 minutes. Is this
normal? Shouldn't the app start once and remain running until I stop
it?

JP
It's normal. The web server may stop web applications that aren't active
to preserve resources. The application starts again whenever someone
requests anything from it.

--
Göran Andersson
_____
http://www.guffa.com
Sep 27 '07 #9
I believe Application_Start fires even when Session State is disabled. It
fires in response to the first request coming in, not due to "Session".
Also, if an application recycles on its own either due to memory pressure or
IIS settings, Application_End will fire and Application_Start will fire again
when the new appdomain comes up. That behavior would be independent of any
requests.
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"Mark Rae [MVP]" wrote:
"IfThenElse" <sq**********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
So Joey's situation is normal then.

Completely.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 27 '07 #10
if it's unrelated to session, then how would it know when the "last" request
was received?

on my session based application, I'm pretty sure the application_end doesn't
fire when the last session dies. That would mean that if there was only user
logged on at a time, every time they logged out, the appdomain would unload
which would be bad for performance.

I reckon it's much more likely to be worker process idle timeout

that's all an educated guess though - I haven't done any definitive tests

Andy
"Peter Bromberg [C# MVP]" <pb*******@yahoo.yohohhoandabottleofrum.comwrote
in message news:FD**********************************@microsof t.com...
>I believe Application_Start fires even when Session State is disabled. It
fires in response to the first request coming in, not due to "Session".
Also, if an application recycles on its own either due to memory pressure
or
IIS settings, Application_End will fire and Application_Start will fire
again
when the new appdomain comes up. That behavior would be independent of any
requests.
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"Mark Rae [MVP]" wrote:
>"IfThenElse" <sq**********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
So Joey's situation is normal then.

Completely.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net


Sep 27 '07 #11
"Peter Bromberg [C# MVP]" <pb*******@yahoo.yohohhoandabottleofrum.comwrote
in message news:FD**********************************@microsof t.com...
>I believe Application_Start fires even when Session State is disabled. It
fires in response to the first request coming in, not due to "Session".
Also, if an application recycles on its own either due to memory pressure
or
IIS settings, Application_End will fire and Application_Start will fire
again
when the new appdomain comes up. That behavior would be independent of any
requests.
Yes, I believe that is correct...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 27 '07 #12
re:
!if it's unrelated to session

It *is* unrelated to session...at the end, but not at the beginning.

At the beginning, they're very much related.
For a session to begin to exist, Application_Start *must* have occurred.

re:
!it's much more likely to be worker process idle timeout

That, or the configured memory/App Pool recycle conditions.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espańol : http://asp.net.do/foros/
======================================
"Andy Fish" <aj****@blueyonder.co.ukwrote in message news:eQ**************@TK2MSFTNGP04.phx.gbl...
if it's unrelated to session, then how would it know when the "last" request was received?

on my session based application, I'm pretty sure the application_end doesn't fire when the last session dies. That
would mean that if there was only user logged on at a time, every time they logged out, the appdomain would unload
which would be bad for performance.

I reckon it's much more likely to be worker process idle timeout

that's all an educated guess though - I haven't done any definitive tests

Andy
"Peter Bromberg [C# MVP]" <pb*******@yahoo.yohohhoandabottleofrum.comwrote in message
news:FD**********************************@microsof t.com...
>>I believe Application_Start fires even when Session State is disabled. It
fires in response to the first request coming in, not due to "Session".
Also, if an application recycles on its own either due to memory pressure or
IIS settings, Application_End will fire and Application_Start will fire again
when the new appdomain comes up. That behavior would be independent of any
requests.
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"Mark Rae [MVP]" wrote:
>>"IfThenElse" <sq**********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl.. .

So Joey's situation is normal then.

Completely.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net



Sep 27 '07 #13
Can anyone write a summary of what has been discussed with few example,
scenarios.

How does an HTTPModule deal with Application_start and Application_End
Events.

Thank you,
"Joey" <jo*********@topscene.comwrote in message
news:11*********************@57g2000hsv.googlegrou ps.com...
asp.net 2/C#

I have noticed that during periods of inactivity on my website, the
Application_Start event is firing about every 40-45 minutes. Is this
normal? Shouldn't the app start once and remain running until I stop
it?

JP

Sep 27 '07 #14
Juan T. Llibre wrote:
re:
!if it's unrelated to session

It *is* unrelated to session...at the end, but not at the beginning.

At the beginning, they're very much related.
For a session to begin to exist, Application_Start *must* have occurred.
Well, not directly. Before a session can start the application has to
have started, but the application is started to handle the request
rather than because it's needed by the session.
re:
!it's much more likely to be worker process idle timeout

That, or the configured memory/App Pool recycle conditions.

--
Göran Andersson
_____
http://www.guffa.com
Sep 27 '07 #15
I believe that application might start even when there are no pending
requests.
IIS monitors changes or health of the application and if it decided that
something has changed or application deadlocked it will restart it even if
there is no one using it right now. (obviously given that application has
not been active before).

George.
"Göran Andersson" <gu***@guffa.comwrote in message
news:eR**************@TK2MSFTNGP05.phx.gbl...
Juan T. Llibre wrote:
>re:
!if it's unrelated to session

It *is* unrelated to session...at the end, but not at the beginning.

At the beginning, they're very much related.
For a session to begin to exist, Application_Start *must* have occurred.

Well, not directly. Before a session can start the application has to have
started, but the application is started to handle the request rather than
because it's needed by the session.
>re:
!it's much more likely to be worker process idle timeout

That, or the configured memory/App Pool recycle conditions.


--
Göran Andersson
_____
http://www.guffa.com

Sep 27 '07 #16
re:
!the application is started to handle the request
!rather than because it's needed by the session

Even the session is not needed.
However, there will be no sessions without the application.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espańol : http://asp.net.do/foros/
======================================
"Göran Andersson" <gu***@guffa.comwrote in message news:eR**************@TK2MSFTNGP05.phx.gbl...
Juan T. Llibre wrote:
>re:
!if it's unrelated to session

It *is* unrelated to session...at the end, but not at the beginning.

At the beginning, they're very much related.
For a session to begin to exist, Application_Start *must* have occurred.

Well, not directly. Before a session can start the application has to have started, but the application is started to
handle the request rather than because it's needed by the session.
>re:
!it's much more likely to be worker process idle timeout

That, or the configured memory/App Pool recycle conditions.


--
Göran Andersson
_____
http://www.guffa.com

Sep 27 '07 #17
First, .NET will recycle rarely used processes at times. This is a
conservation method, although you can configure it not to work this way.

Second, you could have the process set to recycle. This can be done in IIS
or config files.

Third, you might have a problem that is causing the recycle. If so, you
should see entries in the event log.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box!
|
*************************************************
"Joey" <jo*********@topscene.comwrote in message
news:11*********************@57g2000hsv.googlegrou ps.com...
asp.net 2/C#

I have noticed that during periods of inactivity on my website, the
Application_Start event is firing about every 40-45 minutes. Is this
normal? Shouldn't the app start once and remain running until I stop
it?

JP

Sep 28 '07 #18
Hello! Good Site! Thanks you! ninlyxbgcq
Nov 23 '07 #19

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by msnews.microsoft.com | last post: by
7 posts views Thread by Gordon Smith | last post: by
6 posts views Thread by Leslie | last post: by
4 posts views Thread by NoNickname | last post: by
6 posts views Thread by Joe Befumo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.