自动重新启动已关闭的 FastCGI 进程的好策略是什么?
我有一个基于 Perl 的 FastCGI 应用程序,很少出现故障。但是,当它确实出现故障时,不会自动重新启动。手动重新启动 Apache 总是可以解决问题,但这确实可以提高应用程序的正常运行时间。
我正在考虑将 cron
作业与使用 WWW::Mechanize
的脚本结合使用来定期检查应用程序并根据需要重新启动它,如Perl Monks 的朋友们:
在我这样做之前,我想知道是否有人知道更好的方法来监视 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Monit 是一个很好的监控守护进程,可以自动重启和/或通知。
Monit is a nice monitoring daemon that can do automatic restarts and/or notification.
不让 Apache 监控进程,而是使用类似于
init(8)
启动getty
进程的机制怎么样?我发现daemon
非常有用。How about not having the process supervised by Apache but using an mechanism similar to the way
init(8)
startsgetty
processes? I have founddaemon
to be quite useful.大多数网络服务器已经提供此作为配置选项。
Most of the web servers offer already offer this as a configuration option.