【发布时间】:2017-07-12 10:57:17
【问题描述】:
我使用wrk 来测试由ubuntu 16.04 上的主管管理的Web API 服务。有错误“打开的文件太多”,但我设置了系统配置
/etc/security/limits.conf
* soft nofile 65535
* hard nofile 65535
仍然有错误“打开的文件太多”
我发现 supervisord 属于 root 和 cat /proc/PID/limits
Max open files 1024 4096 files
所以,将根限制设置添加到limits.conf,如下所示
root soft nofile 65535
root hard nofile 65535
重启 supervisord 后生效(cat /proc/PID/limits,得到 65535)
但supervisord很快退出,并以1024的限制自动启动。
Jul 12 18:55:53 adhost supervisord[10866]: Error: Another program is already listening on a port that one of our HTTP servers is configured to use. Shut this program down first before starting supervisord.
Jul 12 18:55:53 adhost supervisord[10866]: For help, use /usr/bin/supervisord -h
Jul 12 18:55:53 adhost systemd[1]: supervisor.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Jul 12 18:55:53 adhost supervisorctl[10871]: Shut down
【问题讨论】:
-
这似乎与打开文件限制无关?看起来服务已经在运行了?
-
感谢您的好意@RamanSailopal
标签: linux supervisord