套接字:打开的文件太多 (24) Apache bench lighttpd

发布于 2024-08-06 06:54:45 字数 319 浏览 5 评论 0 原文

当我开始 Apache Bench 测试时:

ab -n 10000 -c 1300 http://example.com/test.php

我收到错误:

套接字:打开的文件太多 (24)

当我将其更改为“-c 1000”时,它工作正常。

因为我可以有超过 1000 个并发用户,所以我想修复套接字打开文件太多的问题或增加参数。如何做到这一点以及在哪里?

我在 CentOS 5 上使用 lighttpd。

When I start Apache Bench test:

ab -n 10000 -c 1300 http://example.com/test.php

I get error:

socket: Too many open files (24)

When I change it to '-c 1000' it works fine.

Because I can have more than 1000 concurrent users I would like to fix socket too many open files problem or increase parameter. How to do this and where?

I use lighttpd on CentOS 5.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

寄居人 2024-08-13 06:54:45
ulimit -n 10000

这可能不起作用,具体取决于您的系统配置
请参阅来配置您的系统。

ulimit -n 10000

That might not work depending on you system configuration
Consult this to configure your system.

素衣风尘叹 2024-08-13 06:54:45

要永久更改最大打开文件限制,您应该修改 /etc/security/limits.conf 并重新启动系统:

echo -ne " 
* soft nofile 65536 
* hard nofile 65536 
" >>/etc/security/limits.conf 

to permernent change max opened files limit, you should modify /etc/security/limits.conf and reboot system:

echo -ne " 
* soft nofile 65536 
* hard nofile 65536 
" >>/etc/security/limits.conf 
任性一次 2024-08-13 06:54:45

查看 lighty 的文档。您可能必须设置 server.max-fds 选项。另外 server.max-connections 应相应更改(再次参见 文档)。

Check out the documentation for lighty. You might have to set the server.max-fds option. Also server.max-connections should be changed accordingly (again, see the documentation).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文