![我如何确保 varnish 始终有一个子进程在运行?](https://linux22.com/image/699579/%E6%88%91%E5%A6%82%E4%BD%95%E7%A1%AE%E4%BF%9D%20varnish%20%E5%A7%8B%E7%BB%88%E6%9C%89%E4%B8%80%E4%B8%AA%E5%AD%90%E8%BF%9B%E7%A8%8B%E5%9C%A8%E8%BF%90%E8%A1%8C%EF%BC%9F.png)
我时不时会遇到 Varnish 盒子上的问题,导致 Varnish 的子进程死亡。它通常看起来像这样:
Feb 26 17:09:45 webstar varnishd[9775]: Child (32289) not responding to CLI, killing it.
Feb 26 17:09:55 webstar varnishd[9775]: Child (32289) not responding to CLI, killing it.
Feb 26 17:10:00 webstar varnishd[9775]: Child (32289) not responding to CLI, killing it.
Feb 26 17:10:00 webstar varnishd[9775]: Child (32289) not responding to CLI, killing it.
Feb 26 17:10:00 webstar varnishd[9775]: Child (32289) died signal=3
Feb 26 17:10:00 webstar varnishd[9775]: Child cleanup complete
Feb 26 17:10:00 webstar varnishd[9775]: child (30475) Started
Feb 26 17:10:10 webstar varnishd[9775]: Pushing vcls failed:#012CLI communication error (hdr)
Feb 26 17:10:10 webstar varnishd[9775]: Stopping Child
Feb 26 17:10:10 webstar varnishd[9775]: Child (30475) said Child starts
Feb 26 17:10:27 webstar varnishd[9775]: Child (30475) said Child dies
Feb 26 17:10:28 webstar varnishd[9775]: Child (30475) died status=1
Feb 26 17:10:28 webstar varnishd[9775]: Child cleanup complete
重新启动 varnish 服务通常可以修复该问题,当我深入研究原因时,发现通常是由于某种资源受到限制。
这一切都符合预期,但这确实意味着在子进程被终止和我手动解决问题之间,该 varnish 框无法提供任何流量。当旧子进程终止时,我该怎么做才能自动生成新的子进程?是否可以配置父 varnish 进程来自己处理这个问题,或者当出现此问题时,唯一的选择是让外部程序(例如 puppet 或 chef)重新启动?