遇到LSPHP进程不断重启导致网站加载很慢的解决办法

最近搬主题发现网站突然变得有点慢,有时候会丢失PHP进程会话,不懂哪里出了问题。虽然网站还是正常运行,总感觉不爽,于是搬主题检查了一下日志,发现一个问题。日志里有大量的LSPHP进程不断重启的记录,如下

2022-01-18 12:25:09.089358 [INFO] [753246] [LSPHP] detect restart request, stopping ...
2022-01-18 12:25:19.026103 [INFO] [753246] [LSPHP] detect restart request, stopping ...
2022-01-18 12:25:29.061187 [INFO] [753246] [lsPHP] detect restart request, stopping ...
2022-01-18 12:25:39.010827 [INFO] [753246] [lsPHP] detect restart request, stopping ...
2022-01-18 12:25:49.003068 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:25:59.008744 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:26:09.046763 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:26:19.003400 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:26:29.049794 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:26:39.090653 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:26:49.029251 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:26:59.088360 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:27:09.058919 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:27:19.094686 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:27:29.009170 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:27:39.066870 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:27:49.062644 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:27:59.040132 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:28:09.078349 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:28:19.046406 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:28:29.020600 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:28:39.099785 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:28:49.017589 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:28:59.079596 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:29:09.088982 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:29:19.064147 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:29:29.043597 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:29:39.013439 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:29:49.046521 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:29:59.037448 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:30:09.002008 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:30:19.035069 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:30:29.046636 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:30:39.078811 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:30:49.061091 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:30:59.008919 [INFO] [753246] [lsphp] detect restart request, stopping ...
2022-01-18 12:31:09.050965 [INFO] [753246] [lsphp] detect restart request, stopping ...

也就是每隔10秒钟就会接收到LSPHP进程要重启的请求,然后重新启动。因为搬主题使用的是LSPHP分离模式,因此不会对网站造成影响,也就是重启后自动启动,所以网站基本没有影响。

但是这是什么问题造成的呢?

经过搬主题的分析,应该是不断重新重启LSPHP进程的时候,如果有各类PHP的请求的话,那网站自然要等PHP进程启动完成后才能回应各类请求了,所以网站会出现偶尔缓慢的情况。

那到底是哪里会造成LSPHP进程不断重启的请求呢?

经过判断,搬主题分析应该是前几天升级了依赖软件包,所以升级完后,应该有重启进程的请求,但是因为某些原因导致没有重启成功,然后一直出现这个请求。

于是,搬主题使用重启LSWS的命令

systemctl restart lsws.service

重启后,观察了一下,没有这类问题出现了。

千百度
© 版权声明
THE END
喜欢就支持一下吧
点赞8 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容