本文介绍了如何处理HHVM崩溃或何时无响应?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前状态如下:Nginx-> HHVM-> PHP5-FPM.

Current state is like this: Nginx -> HHVM -> PHP5-FPM.

HHVM崩溃(经常)时,它会返回502错误.

When HHVM crashes (quite often) it returns 502 error.

我对@nginx配置做了@fallback解决方法,但是我需要手动重新启动hhvm.

I did @fallback workaround to nginx configuration, but I need to manually restart hhvm.

此处在HHVM停止时自动重新启动响应但进程未死描述了一些PID侦听器cron,但有时hhvm对现有pid无响应.

here Automatically restarting HHVM when it stops responding but process not dead some PID listener cron is described, but sometimes hhvm just unresponsive with existing pid.

如何进行监控?

推荐答案

我有完全相同的问题-HHVM随机无响应(我还没弄清楚为什么)

I have the exact same problem - HHVM becomes unresponsive randomly (I haven't figured out why yet)

这是我监视HHVM的方式:

Here is how I monitor HHVM:

我创建了一个简单的status.php:

I created a simple status.php:

<?php echo 'status' ?>

然后我创建了status.sh bash文件:

Then I created status.sh bash file:

#! /bin/bash
STATUS="`timeout -s KILL 13 wget -T 13 -q -O -  http://domain.com/status.php`"
if [ "$STATUS" != "status" ]
then
  /etc/init.d/hhvm stop
  /etc/init.d/hhvm start
fi

然后,我创建了一个每分钟运行一次的cron作业:

Then I created a cron job that runs every minute:

* * * * * /bin/bash /var/www/camera.new/status.sh

您可以调整超时(当前为13秒).我认为,如果HHVM在13秒钟内未运行简单的status.php文件,则该重新启动了.

You can adjust timeout (currently - 13s). I think if HHVM doesn't run the simple status.php file for 13s it is time to restart.

这篇关于如何处理HHVM崩溃或何时无响应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 05:53