.Net Core闲置后变慢 [英] .Net Core Slow after idle

查看:418
本文介绍了.Net Core闲置后变慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个新的.netcore Web应用程序已部署到Windows Server 2008R2 IIS实例,并且该应用程序闲置了一段时间后,第一次加载时速度很慢,然后后续请求速度很快.

在.net的早期版本中,我将IIS中应用程序池的空闲超时"属性更改为0,以解决此问题. .netcore的某个地方是否有类似的设置,也许我错过了可以添加到Startup.cs文件中的东西?

解决方案

除非我不熟悉.netcore,否则请提供合理的修复程序;编写一条返回HTTP 200或类似心跳信号的路由,然后每隔X分钟(空闲-1)从调度的任务中调用该路由,将防止应用程序一直处于空闲状态,从而阻止其减慢请求的速度.

I have a new .netcore web app deployed to a windows server 2008R2 IIS instance, and after the app has been idle for a while, it's slow upon first load, and then subsequent requests are super fast.

In previous versions of .net I changed the Idle Time-out property of the app pool in IIS to 0 to fix this issue. Is there a similar setting somewhere with .netcore, perhaps something I've missed I could add to the Startup.cs file?

解决方案

Baring there being a legitimate fix as I am unfamiliar with .netcore; writing a route which returns an HTTP 200 or something as a heartbeat and then calling it from a scheduled task every X minutes(idle - 1) would prevent the application from ever idling and thus keep it from slowing down requests.

这篇关于.Net Core闲置后变慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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