vps又不正常

我的vps又不正常,我上午都想换一个虚拟空间了

查看 php-fpm.log 日志文件,里面全是 这些错误

Jul 11 15:12:44.683487 [WARNING] fpm_stdio_child_said(), line 167: child 29950 (pool default) said into stderr: "Jul 11 15:12:44.679996 [ERROR] fpm_unix_init_child(), line 168: setrlimit(RLIMIT_NOFILE) failed: Invalid argument (22)"

Jul 11 15:12:44.683496 [WARNING] fpm_stdio_child_said(), line 167: child 29949 (pool default) said into stderr: "Jul 11 15:12:44.679035 [ERROR] fpm_unix_init_child(), line 168: setrlimit(RLIMIT_NOFILE) failed: Invalid argument (22)"

Jul 11 15:12:44.683506 [WARNING] fpm_stdio_child_said(), line 167: child 29948 (pool default) said into stderr: "Jul 11 15:12:44.677968 [ERROR] fpm_unix_init_child(), line 168: setrlimit(RLIMIT_NOFILE) failed: Invalid argument (22)"

Jul 11 15:12:44.683515 [WARNING] fpm_stdio_child_said(), line 167: child 29947 (pool default) said into stderr: "Jul 11 15:12:44.676525 [ERROR] fpm_unix_init_child(), line 168: setrlimit(RLIMIT_NOFILE) failed: Invalid argument (22)"

Jul 11 15:12:44.683561 [WARNING] fpm_stdio_child_said(), line 167: child 29946 (pool default) said into stderr: "Jul 11 15:12:44.667937 [ERROR] fpm_unix_init_child(), line 168: setrlimit(RLIMIT_NOFILE) failed: Invalid argument (22)"

Jul 11 15:12:44.683571 [WARNING] fpm_stdio_child_said(), line 167: child 29945 (pool default) said into stderr: "Jul 11 15:12:44.666913 [ERROR] fpm_unix_init_child(), line 168: setrlimit(RLIMIT_NOFILE) failed: Invalid argument (22)"

Jul 11 15:12:44.683581 [WARNING] fpm_stdio_child_said(), line 167: child 29944 (pool default) said into stderr: "Jul 11 15:12:44.665933 [ERROR] fpm_unix_init_child(), line 168: setrlimit(RLIMIT_NOFILE) failed: Invalid argument (22)"

Jul 11 15:12:44.683591 [WARNING] fpm_stdio_child_said(), line 167: child 29943 (pool default) said into stderr: "Jul 11 15:12:44.664951 [ERROR] fpm_unix_init_child(), line 168: setrlimit(RLIMIT_NOFILE) failed: Invalid argument (22)"

Jul 11 15:12:44.683601 [WARNING] fpm_stdio_child_said(), line 167: child 29942 (pool default) said into stderr: "Jul 11 15:12:44.663902 [ERROR] fpm_unix_init_child(), line 168: setrlimit(RLIMIT_NOFILE) failed: Invalid argument (22)"

这些错误说明 php-fpm 打开文件限制超过了系统限制的 能打开的文件限制

使用

ulimit -n

看一下,然后 cd到你的php-fpm.conf文件夹 (locate php-fpm.conf)

使用命令

cat php-fpm.conf | grep rlimit

出来<value name="rlimit_files">XXX</value>

只要把 两处的数字改成一样的 就可以了

方法有两个

一、修改php-fpm 设置

<value name="rlimit_files">XXXX</value>

中的数字改为 上面查询的数字,然后重启 php-fpm

我是这样操作的

vi /usr/local/webserver/php/etc/php-fpm.conf

修改数字

/usr/local/webserver/php/sbin/php-fpm restart

二、修改系统限制

vi /etc/security/limits.conf

加上

*        soft    nofile  65535

*        hard    nofile  65535

好像我前面写过这些了,不过我设置错了

目前还有其他错误,不过 ping 返回的值 到了600ms 多,连接已经打不开了

其他错误代码

Jul 11 15:18:06.427259 [NOTICE] fpm_children_make(), line 352: child 11495 (pool default) started

Jul 11 15:18:06.428865 [NOTICE] fpm_children_make(), line 352: child 11496 (pool default) started

Jul 11 15:18:06.430004 [NOTICE] fpm_children_make(), line 352: child 11497 (pool default) started

Jul 11 15:18:06.430985 [NOTICE] fpm_children_make(), line 352: child 11498 (pool default) started

Jul 11 15:18:06.431983 [NOTICE] fpm_children_make(), line 352: child 11499 (pool default) started

Jul 11 15:18:06.432939 [NOTICE] fpm_children_make(), line 352: child 11500 (pool default) started

Jul 11 15:18:06.433915 [NOTICE] fpm_children_make(), line 352: child 11501 (pool default) started

Jul 11 15:18:06.435061 [NOTICE] fpm_children_make(), line 352: child 11502 (pool default) started

Jul 11 15:18:06.436449 [NOTICE] fpm_children_make(), line 352: child 11503 (pool default) started

Jul 11 15:18:06.437712 [NOTICE] fpm_children_make(), line 352: child 11504 (pool default) started

Jul 11 15:18:06.438704 [NOTICE] fpm_children_make(), line 352: child 11505 (pool default) started

Jul 11 15:18:06.438735 [NOTICE] fpm_event_loop(), line 107: libevent: entering main loop

版权声明:
作者:xinyu2ru
链接:https://www.rxx0.com/jinzhan/vps-not-normal.html
来源:RUBLOG-分享我的生活
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>