IIS 10应用程序池入睡 [英] IIS 10 Application Pool fall a sleep

查看:101
本文介绍了IIS 10应用程序池入睡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有内部使用的ASP.NET Core应用程序,这些应用程序在办公时间内使用,并且应按HangFire的安排,每天早上3点处理此批处理,如下所示:

We have ASP.NET Core application used internally which are used during office hours and a batch that should be processed 3 AM every morning which is scheduled by HangFire like this:

RecurringJob.AddOrUpdate(
                () => MyBatch(),
                "0 0 3 1/1 *");

问题在于,如果未手动启动网站(通常通过进入网站),那么应用程序池将进入睡眠状态,并且不会处理该批处理.

The problem is that the Application Pool goes to sleep and the batch isn’t processed if the site isn’t manually started (by going to the website usually).

我已经搜索了SO,并在应用程序池中篡改了这些设置,但没有成功:

I have searched SO and tampered with these settings in the Application Pool but with no success:

一些我用来修改设置的来源:

Some sources that I used to modify the settings:

  • How to prevent/extend idleTimeout in IIS 7?
  • https://serverfault.com/questions/443065/how-do-i-prevent-iis-8-from-stopping-idle-asp-net-applications
  • IIS seems like to sleep until the next request

共有7个应用程序使用了应用程序池"(在应处理该批处理的夜间,所有这些应用程序都处于非活动状态).使用的应用程序池使用.NET CLR Version 2.0. 我正在使用IIS版本10.0.17134.1.

The Application Pool is used by a total of 7 applications (all being inactive during night when the batch should be processed). The used Application Pool uses .NET CLR Version 2.0. I'm using IIS version 10.0.17134.1.

如何使应用程序池保持活动状态,以便可以每天早晨定期调用该批处理?

推荐答案

我遇到了同样的问题,即使"AlwaysRunning"作为应用程序池的启动模式,"Preload Enabled",我的ASP.NET核心应用程序也进入了空闲状态.将该站点设置为true,并将空闲超时设置为0. 我通过安装

I ran into the same issue where my ASP.NET core application goes into idle even with "AlwaysRunning" as start mode for the app pool, "Preload Enabled" set to true for the site, and idle timeout set to 0. I got it to work by installing the Application Initialization module and setting the .NET CLR version to v4.0. Don't use the "No Managed Code" as that would prevent the Always Running from triggering the app start.

我写了一个

I wrote a blog post on this explaining in more details the steps I took to get the app to run continuously.

这篇关于IIS 10应用程序池入睡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆