473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

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 2126
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: AW | last post by:
Hi all, In my Application_Start, I'm initializing the application. ASP.Net calls my Application_Start on the first request, not on the following ones. However, if something goes wrong in my...
6
by: Ober | last post by:
I'm having trouble with my security model, Application_Start, and accessing my database. My ASP.NET app is only going to be running in an intranet environment (not on the public Internet). ...
3
by: msnews.microsoft.com | last post by:
Hi What can you do with the errors occuring in global.asax in Application_Start (or Init) ? What is the best practice here ? What's the elegant solution in this case ? For now (I'm learning)...
7
by: Gordon Smith | last post by:
I have four (4) ASP.NET Web applications/Web sites on a IIS/6 - Windows Server 2003 production server. 3 of them work fine. I just installed the 4th one and it's Application_Start event is not...
0
by: SeanGallavan | last post by:
Our Environment: Two network load balanced (using Microsoft NLB software) webservers with session maintained in a SQL Server database. NLB is configured with no affinity settings and two...
6
by: Leslie | last post by:
I am attempting to handle errors by using Application_Error. This seems to work fine in most situations. However, if the exception occurs during the Application_Start method, the stand error...
4
by: Marc Missire | last post by:
Hi, I have an issue below I'd love help with, involving a static variable, Application_Start, and a background thread. In global.asax.cs I have a static variable (outside any method) with a...
8
by: bryan | last post by:
Is there any way I can get the application path (the one returned by Request.ApplicationPath) in the Application_Start method in Global.asax? Request is not valid there. On a related note, is there...
4
by: NoNickname | last post by:
Hi, I need to get a string from a COM component at application start. (It's a Long Story and I cannot change this fact.) In ASP.NET 1.1, I simply called this COM component in Global.asax.cs...
6
by: Joe Befumo | last post by:
I just created the default personal site project in Visual Studio 2005, and it worked perfectly -- very nice. Next, I'd like to import some stat-capture code that I have working in a Visual Studio...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.