469,954 Members | 1,707 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

I dont want that application stop

Hi,

I have an asp.net application. And I have worker threads which must run
always (7x24).

I start my threads in Application_Start, and I stop its in Application_Stop
events. I log this events. I see that when all sessions time out, Application
stops. How can prevent application stop?
--
______________________________
Şenol Akbulak
Nov 19 '05 #1
13 2390
A (likely bad) way would be to trigger a request on a page of this app on a
regular bais so that you always have someone connected...

Actually it looks like you would need to create a Windows service rather
than a web application. Why should this application always run ?

Patrice
--

"Senol Akbulak" <se**********@newsgroup.nospam> a crit dans le message de
news:84**********************************@microsof t.com...
Hi,

I have an asp.net application. And I have worker threads which must run
always (7x24).

I start my threads in Application_Start, and I stop its in Application_Stop events. I log this events. I see that when all sessions time out, Application stops. How can prevent application stop?
--
______________________________
Senol Akbulak

Nov 19 '05 #2
> Why should this application always run ?
Because it checks some states and if needed it sends email. It must check
every minute.
Actually it looks like you would need to create a Windows service rather
than a web application. Because manage and maintenance easier than windows service.
A (likely bad) way would be to trigger a request on a page of this app on a
regular bais so that you always have someone connected... Is not there any likely solution?

"Patrice" wrote:
A (likely bad) way would be to trigger a request on a page of this app on a
regular bais so that you always have someone connected...

Actually it looks like you would need to create a Windows service rather
than a web application. Why should this application always run ?

Patrice
--

"Senol Akbulak" <se**********@newsgroup.nospam> a écrit dans le message de
news:84**********************************@microsof t.com...
Hi,

I have an asp.net application. And I have worker threads which must run
always (7x24).

I start my threads in Application_Start, and I stop its in

Application_Stop
events. I log this events. I see that when all sessions time out,

Application
stops. How can prevent application stop?
--
______________________________
Senol Akbulak


Nov 19 '05 #3
If you don't want to create a Windows service (AFAIK .NET allows to do that
quite easily) it could be just a regular application that is :
- either scheduled to be lauched every minute
- or is launched one time and wake up itself every minute

I'm not aware of such a settings but perhaps a web.config, machine.config or
IIS setting would allow to keep the web application in memory forever.
The last resort I see would be to issue this HTTP request to itself when
waking up allowing to have the application using itself allowing to keep
running forever...

It could also be triggered by the original source event (for example if this
is caused by data written in a SQL DB, a trigger could then laucn immediatly
the appropriate processing when a new row is added in the table).
Patrice
--

"Senol Akbulak" <se**********@newsgroup.nospam> a crit dans le message de
news:B9**********************************@microsof t.com...
Why should this application always run ?

Because it checks some states and if needed it sends email. It must check
every minute.
Actually it looks like you would need to create a Windows service rather
than a web application.

Because manage and maintenance easier than windows service.
A (likely bad) way would be to trigger a request on a page of this app on a regular bais so that you always have someone connected...

Is not there any likely solution?

"Patrice" wrote:
A (likely bad) way would be to trigger a request on a page of this app on a regular bais so that you always have someone connected...

Actually it looks like you would need to create a Windows service rather
than a web application. Why should this application always run ?

Patrice
--

"Senol Akbulak" <se**********@newsgroup.nospam> a crit dans le message de news:84**********************************@microsof t.com...
Hi,

I have an asp.net application. And I have worker threads which must run always (7x24).

I start my threads in Application_Start, and I stop its in

Application_Stop
events. I log this events. I see that when all sessions time out,

Application
stops. How can prevent application stop?
--
______________________________
Senol Akbulak


Nov 19 '05 #4
A long time ago I tried to get an answer to this very same question. It is a
web application that caches many things, so whenever it has to start up from
scratch, it has a few-second delay. This degrades the user experience for
the "first" user who hits the web app after it has been stopped by IIS/.NET.

Unless something has changed in the last year, the only solutions I ever
found were by creating a function within the Global.asax with a timer that
would browser to a self-contained page (that effectively did nothing), except
simply by "hitting" it would keep a session alive, and thus not allow the
application to end.

I don't have an example because I was not able to get it to work.

I will be curious to see if you find a real working solution to this.
Nov 19 '05 #5
Senol Akbulak wrote:
Hi,

I have an asp.net application. And I have worker threads which must run always (7x24).

I start my threads in Application_Start, and I stop its in Application_Stop events. I log this events. I see that when all sessions time out, Application stops. How can prevent application stop?


What if you don't stop it in Application_Stop? An ASP.NET webapp is
really stopped only when its application domain is unloaded. Your
worker threads should be able to continue even after the
HttpApplication is stopped.

Nov 19 '05 #6
If this is Windows Server 2003, then you can change the "Shutdown
worker process after being idle" time in minutes (or disable the
setting). Go to the IIS MMC -> Computer -> Application Pools and right
click on the pool for your app. The setting is on the performance tab.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 7 Apr 2005 01:19:06 -0700, "?enol Akbulak"
<se**********@newsgroup.nospam> wrote:
Hi,

I have an asp.net application. And I have worker threads which must run
always (7x24).

I start my threads in Application_Start, and I stop its in Application_Stop
events. I log this events. I see that when all sessions time out, Application
stops. How can prevent application stop?


Nov 19 '05 #7
ASP.NET is not a very good fit for your requirements.
Instead, a Windows Service is the most reliable tool for this job.

Here's more information on Windows Services:
http://msdn.microsoft.com/library/de...owsService.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Senol Akbulak" <se**********@newsgroup.nospam> wrote in message
news:84**********************************@microsof t.com...
Hi,

I have an asp.net application. And I have worker threads which must run
always (7x24).

I start my threads in Application_Start, and I stop its in
Application_Stop
events. I log this events. I see that when all sessions time out,
Application
stops. How can prevent application stop?
--
______________________________
Senol Akbulak

Nov 19 '05 #8
If you REALLY don't want to write a windows service (and you really should
for this task), why not just a console app with a timer? Far less overhead
then running it in ASP.NET.

-Steven
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:OH*************@TK2MSFTNGP15.phx.gbl...
ASP.NET is not a very good fit for your requirements.
Instead, a Windows Service is the most reliable tool for this job.

Here's more information on Windows Services:
http://msdn.microsoft.com/library/de...owsService.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Senol Akbulak" <se**********@newsgroup.nospam> wrote in message
news:84**********************************@microsof t.com...
Hi,

I have an asp.net application. And I have worker threads which must run
always (7x24).

I start my threads in Application_Start, and I stop its in
Application_Stop
events. I log this events. I see that when all sessions time out,
Application
stops. How can prevent application stop?
--
______________________________
Senol Akbulak


Nov 19 '05 #9
Hi Senol,

Have you found a proper solution for this issue? How about Scott's suggest
on using the
"shut down worker process after being idle for ..." setting in the
IIS6(WIN2K3) 's application pool setting's performance tab? When unchecking
that option, we can make the process of that application pool always exist
in memory, not be shutdown after being idle.

In addition , as for the
==================
A (likely bad) way would be to trigger a request on a page of this app on a regular bais so that you always have someone connected...

==================

I don't think this is a good approach. So if possible, I suggest you
consider the above setting or the Windows service solution other members
have mentioned.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 19 '05 #10
Thank you for your interest.

I am trying Application Pool settings now. I will return when I finish test.
"Steven Cheng[MSFT]" wrote:
Hi Senol,

Have you found a proper solution for this issue? How about Scott's suggest
on using the
"shut down worker process after being idle for ..." setting in the
IIS6(WIN2K3) 's application pool setting's performance tab? When unchecking
that option, we can make the process of that application pool always exist
in memory, not be shutdown after being idle.

In addition , as for the
==================
A (likely bad) way would be to trigger a request on a page of this app

on a
regular bais so that you always have someone connected...

==================

I don't think this is a good approach. So if possible, I suggest you
consider the above setting or the Windows service solution other members
have mentioned.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 19 '05 #11
OK. Good luck ! :-)

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 19 '05 #12
Thank you Scott;

I tried your solution and it runs always.

"Scott Allen" wrote:
If this is Windows Server 2003, then you can change the "Shutdown
worker process after being idle" time in minutes (or disable the
setting). Go to the IIS MMC -> Computer -> Application Pools and right
click on the pool for your app. The setting is on the performance tab.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 7 Apr 2005 01:19:06 -0700, "?enol Akbulak"
<se**********@newsgroup.nospam> wrote:
Hi,

I have an asp.net application. And I have worker threads which must run
always (7x24).

I start my threads in Application_Start, and I stop its in Application_Stop
events. I log this events. I see that when all sessions time out, Application
stops. How can prevent application stop?


Nov 19 '05 #13
You are quite welcome, and I'm glad to be of help somewhere.

--
Scott
http:// mud

On Mon, 11 Apr 2005 23:22:02 -0700, "?enol Akbulak"
<se**********@newsgroup.nospam> wrote:
Thank you Scott;

I tried your solution and it runs always.

Nov 19 '05 #14

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Google Mike | last post: by
reply views Thread by Ravi Tallury | last post: by
182 posts views Thread by Jim Hubbard | last post: by
2 posts views Thread by tshad | last post: by
5 posts views Thread by =?Utf-8?B?U2Ftc3VkZWVu?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.