How do I set up my IIS to keep my application alive?

前端 未结 6 1418
忘掉有多难
忘掉有多难 2020-12-05 19:06

I think my Webapplication gets shut down after a while.

It returns a new session if I haven\'t used the application in maybe 5 minutes. The session timeout is set to

相关标签:
6条回答
  • 2020-12-05 19:33
    1. Open "IIS Manager"
    2. Select "Application Pool" the instance you want to manage
    3. Select "Advanced settings"
    4. Under "(General)" and set "Start Mode" to "AlwaysRunning", which means the application pool keep the ASP.NET application run always

    PS. If you want the ASP.NET application be loaded automatically, you can follow this:

    1. Open "IIS Manager"
    2. Select the application you want to manage
    3. Select "Advanced settings"
    4. Under "(General)" and set "Preload Enabled" to "true", which means the applicaton will be loaded automatically after its deployment.

    For more information, please visit this:Use IIS Application Initialization for keeping ASP.NET Apps alive

    0 讨论(0)
  • 2020-12-05 19:38

    IIS has a feature in properties where you can stop recycle your IIS on intervals

    1. Go to your "IIS Manager"
    2. Select "Application Pool" the instance you want to manage.
    3. Select "Advanced settings" action
    4. Under "Recycling" and set "Regular Time Interval" to 0, which means the application pool does not recycle.
    0 讨论(0)
  • 2020-12-05 19:38

    The simplest way is to use a script to open a connection to the website and request your page. See Joel Oleson's Blog for more information.

    You can use windows scheduler to run every x minutes.

    This maybe Sharepoint specific but you can adapt to your requirements.

    Update: Try this version: WarmUpServer.zip

    0 讨论(0)
  • 2020-12-05 19:39

    We had the same issue with a web service that had to stay online in such a way that we couldn't afford the latency involved in starting it up if it went stale.

    We wrote a very simple Windows Service that woke up every 3 minutes and requested a page as @Wayne suggested. Worked like a charm.

    0 讨论(0)
  • 2020-12-05 19:47

    After failed at configuring IIS pool. I come out with this simple windows service. github code

    It can save some minutes of you.

    0 讨论(0)
  • 2020-12-05 19:51

    Application pools do recycle, and they do restart after achieving some limits in terms of execution time or number of requests etc, that can be set on IIS.

    IIS 7 actually runs in pipeline mode so its something new which we dont know yet for sure, but all you can do to make your app alive is to set a trigger from some other machine which will connect your server in every 5 or 10 or 60 minutes and try to fetch one html page.

    There can be various server monitors for http as well.

    0 讨论(0)
提交回复
热议问题