Is it possible to disable ASP.NET site sleep in IIS?

I run my site in IIS, and I have several working timers with events there. (I know this is a bad design and plan to transcode it, but at the moment I want to check if there is a quick solution)

After some time, the website is going to sleep and why my actions with timers do nothing.

Is there an IIS setting or other way to reject sleep?

+6
source share
1 answer

Well, this may be useful for you, as described here: -

http://forums.asp.net/t/1950241.aspx?ASP+NET+MVC+website+goes+to+sleep+How+to+nake+it+always+awake+

There are many ways to set timeouts in .NET (session timeouts, legacy form timeouts, and IIS related timeouts). Your problem most likely relates to the IIS Idle Timeout, as follows:

Setting the IdleTimeout property of an application in IIS: -

You may need to check if your timeout is configured in IIS, as this timeout will override the timeouts defined in your web.config.

IIS has a parameter called Idle Timeout, which defaults to 20 minutes. This may explain your problem with an early timeout.

Setting IdleTimeout Property in IIS

Scott Hanselman also addresses the strange problems that can arise when working with timeouts when using form authentication in this blog post .

Some other common timeouts may go through session or form authentication, which will be adjusted as shown below.

Setting SessionState timeout in your web.config: -

You can update the timeout property of your session state (if this is what is actually a timeout) in your web.config file in an element as shown below (the default is 20 minutes, shown below):

<configuration> <system.web> <!-- Adjust the timeout property below --> <sessionState mode="InProc" timeout="20"></sessionState> </system.web> </configuration> 

Setting forms authentication timeout in web.config file: -

You can configure a specific timeout property of your forms authentication in your application by setting a timeout property in the element of your web.config file. You should also remember that if you use the slideExpiration property in combination with timeouts, as they can expire much earlier than the specified timeout.

 <authentication mode="Forms"> <forms name=".ASPXAUTH" loginUrl="~/Login.aspx" timeout="yourTimeoutInMinutes"></forms> </authentication> 

So, if you want to increase the amount that the authentication token remains โ€œaliveโ€ to say 360 minutes (6 hours), you must set it as shown below:

 <authentication mode="Forms"> <forms name=".ASPXAUTH" loginUrl="~/Login.aspx" timeout="360"></forms> </authentication> 
+4
source

All Articles