当 Web 应用程序处于非活动状态时 ASP.NET Worker 进程被终止

发布于 2024-12-17 02:49:05 字数 245 浏览 5 评论 0原文

我的托管 ASP.NET MVC 应用程序启动时需要很长时间(10-20 秒)。并且ASP.NET工作进程运行后,一切正常。问题是当网站不活动(即没有用户)时,工作进程会被终止。这将给下一个用户带来很长的等待时间来加载网站。

我知道网络上有商业或免费服务可以使您的网络工作进程活跃起来。但我需要自己使用简单的计时器 Windows 服务来完成此操作。那里没问题。但我的问题是,有什么有效的方法让它活下去呢?一个简单的 ping 就能做到吗?还是需要从网站下载?

My hosted ASP.NET MVC app takes long time (10-20 secs) when it launches. And after ASP.NET worker process is running, everything is normal. Problem is that the worker process is getting killed when the web site is inactive (i.e., no user). This will give the next user very long wait time to load the web site.

I know there is commercial or free services on the web that makes your web worker process alive. But I need to do that myself with simple timer windows service. No problem there. But my question is what is effective way to makes it alive? Would a simple ping do it or is downloading from the web site necessary?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一桥轻雨一伞开 2024-12-24 02:49:05

我建议您在网站上设置一个空的 aspx 页面,看看偶尔请求它是否可以满足您的要求。您只需提出让工人存活的请求即可。

I'd recommend you set up an empty aspx page on the site and see if requesting it occasionally will fulfill your requirement. You should only have to make a request to keep the worker alive.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文