nginx 上传文件报错

Yiner
  • 371
2012/11/20 13:05:10 [crit] 16779#0: accept4() failed (24: Too many open files)
2012/11/20 13:05:10 [crit] 16779#0: accept4() failed (24: Too many open files)
2012/11/20 13:05:11 [crit] 16779#0: accept4() failed (24: Too many open files)
2012/11/20 13:05:11 [crit] 16779#0: accept4() failed (24: Too many open files)
2012/11/20 13:05:12 [crit] 16779#0: accept4() failed (24: Too many open files)
2012/11/20 13:05:12 [crit] 16779#0: accept4() failed (24: Too many open files)
2012/11/20 13:05:13 [crit] 16779#0: accept4() failed (24: Too many open files)
2012/11/20 13:05:13 [crit] 16779#0: accept4() failed (24: Too many open files)
2012/11/20 13:05:14 [crit] 16779#0: accept4() failed (24: Too many open files)
2012/11/20 13:05:14 [crit] 16779#0: accept4() failed (24: Too many open files)
2012/11/20 13:05:15 [crit] 16779#0: accept4() failed (24: Too many open files)
回复
阅读 5k
1 个回答
✓ 已被采纳

看起来是受到了系统对进程能够打开的最大文件数量限制,accept4系统调用无法获取新的文件描述符。可以使用ulimit -n来修改这个限制。

ulimit命令的修改在重启后会失效。对于不同的linux发行版,这个初始值是放在不同的配置文件中的,详情参考Google。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏