套接字:打开的文件太多 (24) Apache bench lighttpd
当我开始 Apache Bench 测试时:
ab -n 10000 -c 1300
http://example.com/test.php
我收到错误:
套接字:打开的文件太多 (24)
当我将其更改为“-c 1000”时,它工作正常。
因为我可以有超过 1000 个并发用户,所以我想修复套接字打开文件太多的问题或增加参数。如何做到这一点以及在哪里?
我在 CentOS 5 上使用 lighttpd。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这可能不起作用,具体取决于您的系统配置
请参阅此来配置您的系统。
That might not work depending on you system configuration
Consult this to configure your system.
要永久更改最大打开文件限制,您应该修改 /etc/security/limits.conf 并重新启动系统:
to permernent change max opened files limit, you should modify /etc/security/limits.conf and reboot system:
查看 lighty 的文档。您可能必须设置
server.max-fds
选项。另外server.max-connections
应相应更改(再次参见 文档)。Check out the documentation for lighty. You might have to set the
server.max-fds
option. Alsoserver.max-connections
should be changed accordingly (again, see the documentation).