自动重新启动已关闭的 FastCGI 进程的好策略是什么?

发布于 2024-08-04 04:13:31 字数 414 浏览 5 评论 0原文

我有一个基于 Perl 的 FastCGI 应用程序,很少出现故障。但是,当它确实出现故障时,不会自动重新启动。手动重新启动 Apache 总是可以解决问题,但这确实可以提高应用程序的正常运行时间。

我正在考虑将 cron 作业与使用 WWW::Mechanize 的脚本结合使用来定期检查应用程序并根据需要重新启动它,如Perl Monks 的朋友们:

保持 FastCGI 进程正常运行

在我这样做之前,我想知道是否有人知道更好的方法来监视 FastCGI 进程并在其终止时自动重新启动它,或者上面建议的方法是最佳方法吗?

谢谢。

I've got a Perl based FastCGI app that rarely goes down. However, when it does go down, the restart is not automatic. Restarting Apache manually always does the trick but that does address improving the uptime of the app.

I'm thinking of using a cron job in conjunction with a script that uses WWW::Mechanize to periodically check on the app and restart it as required, as suggested by the folks at Perl Monks :

Keep FastCGI Processes Up and Running

Before I do that, I'm want to know if anyone knows of better ways to monitor a FastCGI process and restarting it automatically when it dies, or is the method suggested above the optimal one?

Thanks.

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

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

发布评论

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

评论(3

影子是时光的心 2024-08-11 04:13:31

Monit 是一个很好的监控守护进程,可以自动重启和/或通知。

Monit is a nice monitoring daemon that can do automatic restarts and/or notification.

dawn曙光 2024-08-11 04:13:31

不让 Apache 监控进程,而是使用类似于 init(8) 启动 getty 进程的机制怎么样?我发现 daemon 非常有用。

How about not having the process supervised by Apache but using an mechanism similar to the way init(8) starts getty processes? I have found daemon to be quite useful.

与风相奔跑 2024-08-11 04:13:31

大多数网络服务器已经提供此作为配置选项。

Most of the web servers offer already offer this as a configuration option.

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