Keep IIS Alive

M

mail747097

I would like to keep IIS alive on my web site and prevent
Application_End from occuring in global.asax. Any ideas?
 
J

Juan T. Llibre

You don't want to do that.
Application recycling is of great help in managing server resources, particularly RAM.

If you prevent Application recycling from occurring, you'll see a progressive memory load
which will cause deterioration of the server's capacity to respond to requests, and you
might even see a total failure of the server.

If your server's memory load isn't excessive, you might want to consider
scheduling application recyclings so they occur at the time your server
gets the least number of requests ( usually, between midnight and 4am ).
 
M

mail747097

You don't want to do that.
Application recycling is of great help in managing server resources, particularly RAM.

If you prevent Application recycling from occurring, you'll see a progressive memory load
which will cause deterioration of the server's capacity to respond to requests, and you
might even see a total failure of the server.

If your server's memory load isn't excessive, you might want to consider
scheduling application recyclings so they occur at the time your server
gets the least number of requests ( usually, between midnight and 4am ).

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/





- Visa citerad text -


Thanks for yor answer. I can imagine that if I extend the timeout for
each session so they live forever it could mean the total failure of
the server. However I would just like to keep one instance alive or
find some other way to reload it so Application_End do not occur. Or
to restart it when it occurs.

I do not see how recycling the application pool would accomplish this.
Ok if I succeed to keep the application alive I would not mind
recycling the application pool at night.

Some background. I have a workflow that is published as a webservice
and I have discovered that when Application_End occurs the workflow
stops too. I have tried to manually load a page from the web site and
then the workflow starts up again. I have added some code to
Application_Start and Application_End to start and stop the WWF
engine.
 
J

Juan T. Llibre

re:
!> if I succeed to keep the application alive I would not mind
!> recycling the application pool at night

You cannot keep an application "alive" if it ends.
All you can do is restart it after it ends.

re:
!> I have discovered that when Application_End occurs the workflow stops too

That behavior is by design. It's supposed to work that way.
Otherwise the memory resources can't be disposed of, so a clean slate occurs.

re:
!> I have tried to manually load a page from the web site and then the workflow starts up again.

You can setup a batch file which does that, which you can schedule at your lowest-traffic time.

That batch file could include :

1. the application recycling ( or, perhaps, even, a complete IIS reset )
2. the loading of a page, or several pages, from the web site so the workflow starts up again

Windows Scheduler can do that quite easily.

In the morning, all you'd have to do is close the server's browser
....or you could kill iexplore.exe's process programmatically ( using another scheduled process ).





You don't want to do that.
Application recycling is of great help in managing server resources, particularly RAM.

If you prevent Application recycling from occurring, you'll see a progressive memory load
which will cause deterioration of the server's capacity to respond to requests, and you
might even see a total failure of the server.

If your server's memory load isn't excessive, you might want to consider
scheduling application recyclings so they occur at the time your server
gets the least number of requests ( usually, between midnight and 4am ).

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/





- Visa citerad text -


Thanks for yor answer. I can imagine that if I extend the timeout for
each session so they live forever it could mean the total failure of
the server. However I would just like to keep one instance alive or
find some other way to reload it so Application_End do not occur. Or
to restart it when it occurs.

I do not see how recycling the application pool would accomplish this.
Ok if I succeed to keep the application alive I would not mind
recycling the application pool at night.

Some background. I have a workflow that is published as a webservice
and I have discovered that when Application_End occurs the workflow
stops too. I have tried to manually load a page from the web site and
then the workflow starts up again. I have added some code to
Application_Start and Application_End to start and stop the WWF
engine.
 
M

mail747097

re:
!> if I succeed to keep the application alive I would not mind
!> recycling the application pool at night

You cannot keep an application "alive" if it ends.
All you can do is restart it after it ends.

re:
!> I have discovered that when Application_End occurs the workflow stops too

That behavior is by design. It's supposed to work that way.
Otherwise the memory resources can't be disposed of, so a clean slate occurs.

re:
!> I have tried to manually load a page from the web site and then the workflow starts up again.

You can setup a batch file which does that, which you can schedule at your lowest-traffic time.

That batch file could include :

1. the application recycling ( or, perhaps, even, a complete IIS reset )
2. the loading of a page, or several pages, from the web site so the workflow starts up again

Windows Scheduler can do that quite easily.

In the morning, all you'd have to do is close the server's browser
...or you could kill iexplore.exe's process programmatically ( using another scheduled process ).

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/







Thanks for yor answer. I can imagine that if I extend the timeout for
each session so they live forever it could mean the total failure of
the server. However I would just like to keep one instance alive or
find some other way to reload it so Application_End do not occur. Or
to restart it when it occurs.

I do not see how recycling the application pool would accomplish this.
Ok if I succeed to keep the application alive I would not mind
recycling the application pool at night.

Some background. I have a workflow that is published as a webservice
and I have discovered that when Application_End occurs the workflow
stops too. I have tried to manually load a page from the web site and
then the workflow starts up again. I have added some code to
Application_Start and Application_End to start and stop the WWF
engine.- Dölj citerad text -

- Visa citerad text -

It is important that this site does not affect other sites on the web
server so I can not for example execute iisreset at a regular
interval. Yes I can create a batch file or a Windows service that
retrieves a web page from the site at for example every 5 minutes.
However I was hoping for a better solution.
 
J

Juan T. Llibre

re:
!> It is important that this site does not affect other sites on the web
!> server so I can not for example execute iisreset at a regular interval.

Place the app in its own Application Pool...and only recycle *that* Application Pool.

A simple procedure to do that is described here:
http://blogs.iis.net/chrisad/archiv...g-Application-Pools-using-WMI-in-IIS-6.0.aspx

Another way to do that is described here :
http://www.microsoft.com/technet/technetmag/issues/2005/11/InsideMSCOM/

( recycleapps.vbs <server_name> <apppool_name> )

Recycleapps.vbs is included in this download :
http://download.microsoft.com/download/f/d/0/fd05def7-68a1-4f71-8546-25c359cc0842/InsideMSCOM.exe

If you're not using IIS 6.0, you can open the application's web.config in Notepad,
and use SendKeys to send an <enter> and save the file afterwards...or you can
run an ASP.NET file which does that programmatically, using the

You can schedule *that*, too.





re:
!> if I succeed to keep the application alive I would not mind
!> recycling the application pool at night

You cannot keep an application "alive" if it ends.
All you can do is restart it after it ends.

re:
!> I have discovered that when Application_End occurs the workflow stops too

That behavior is by design. It's supposed to work that way.
Otherwise the memory resources can't be disposed of, so a clean slate occurs.

re:
!> I have tried to manually load a page from the web site and then the workflow starts up again.

You can setup a batch file which does that, which you can schedule at your lowest-traffic time.

That batch file could include :

1. the application recycling ( or, perhaps, even, a complete IIS reset )
2. the loading of a page, or several pages, from the web site so the workflow starts up again

Windows Scheduler can do that quite easily.

In the morning, all you'd have to do is close the server's browser
...or you could kill iexplore.exe's process programmatically ( using another scheduled process ).

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/







Thanks for yor answer. I can imagine that if I extend the timeout for
each session so they live forever it could mean the total failure of
the server. However I would just like to keep one instance alive or
find some other way to reload it so Application_End do not occur. Or
to restart it when it occurs.

I do not see how recycling the application pool would accomplish this.
Ok if I succeed to keep the application alive I would not mind
recycling the application pool at night.

Some background. I have a workflow that is published as a webservice
and I have discovered that when Application_End occurs the workflow
stops too. I have tried to manually load a page from the web site and
then the workflow starts up again. I have added some code to
Application_Start and Application_End to start and stop the WWF
engine.- Dölj citerad text -

- Visa citerad text -

It is important that this site does not affect other sites on the web
server so I can not for example execute iisreset at a regular
interval. Yes I can create a batch file or a Windows service that
retrieves a web page from the site at for example every 5 minutes.
However I was hoping for a better solution.
 
M

mail747097

re:
!> It is important that this site does not affect other sites on the web
!> server so I can not for example execute iisreset at a regular interval.

Place the app in its own Application Pool...and only recycle *that* Application Pool.

A simple procedure to do that is described here:http://blogs.iis.net/chrisad/archive/2006/08/30/Recycling-Application...

Another way to do that is described here :http://www.microsoft.com/technet/technetmag/issues/2005/11/InsideMSCOM/

( recycleapps.vbs <server_name> <apppool_name> )

Recycleapps.vbs is included in this download :http://download.microsoft.com/download/f/d/0/fd05def7-68a1-4f71-8546-...

If you're not using IIS 6.0, you can open the application's web.config in Notepad,
and use SendKeys to send an <enter> and save the file afterwards...or you can
run an ASP.NET file which does that programmatically, using the

You can schedule *that*, too.

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/


















It is important that this site does not affect other sites on the web
server so I can not for example execute iisreset at a regular
interval. Yes I can create a batch file or a Windows service that
retrieves a web page from the site at for example every 5 minutes.
However I was hoping for a better solution.- Dölj citerad text -

- Visa citerad text -

Thanks for your answer but my problem is that I want to keep the
ASP.NET application alive so the workflow does not stop running if the
web service does not get any requests. Do you think that recycling the
application pool will accomplish that? I am not so sure either that
recycling the application pool every 5 minutes is such a good idea. It
could affect the workflow.
 
J

Juan T. Llibre

re:
!> but my problem is that I want to keep the ASP.NET application alive so the
!> workflow does not stop running if the web service does not get any requests.

....and I already told you that might create more problems than it solves.

I have given you pointers to several solutions which *do* work,
with a minimum of fuss and problems for you and/or your application.

If you don't want to implement any of them...you're on your own.

re:
!> I am not so sure either that recycling the application pool every 5 minutes is such a good idea.

You have completely misunderstood what the suggested solutions do.

The idea is to recycle the application pool ONCE daily, at the time when your application gets
the least requests, and immediately afterwards run a batch file to reinitialize your workflow.

That will accomplish two things : 1. safeguard your app from being stalled by excessive
resource consumtion ( from not being recycled ) ...and 2. : restart your application
so the workflow gets reinitialized.





re:
!> It is important that this site does not affect other sites on the web
!> server so I can not for example execute iisreset at a regular interval.

Place the app in its own Application Pool...and only recycle *that* Application Pool.

A simple procedure to do that is described
here:http://blogs.iis.net/chrisad/archive/2006/08/30/Recycling-Application...

Another way to do that is described here
:http://www.microsoft.com/technet/technetmag/issues/2005/11/InsideMSCOM/

( recycleapps.vbs <server_name> <apppool_name> )

Recycleapps.vbs is included in this download
:http://download.microsoft.com/download/f/d/0/fd05def7-68a1-4f71-8546-...

If you're not using IIS 6.0, you can open the application's web.config in Notepad,
and use SendKeys to send an <enter> and save the file afterwards...or you can
run an ASP.NET file which does that programmatically, using the

You can schedule *that*, too.

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/


















It is important that this site does not affect other sites on the web
server so I can not for example execute iisreset at a regular
interval. Yes I can create a batch file or a Windows service that
retrieves a web page from the site at for example every 5 minutes.
However I was hoping for a better solution.- Dölj citerad text -

- Visa citerad text -

Thanks for your answer but my problem is that I want to keep the
ASP.NET application alive so the workflow does not stop running if the
web service does not get any requests. Do you think that recycling the
application pool will accomplish that? I am not so sure either that
recycling the application pool every 5 minutes is such a good idea. It
could affect the workflow.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top