简体   繁体   English

Python Tornado打开了太多文件

[英]Python Tornado too many files open

I have tornado websocket server, and nginx in front of it. 我有龙卷风websocket服务器,在它前面有nginx。 My files open files limit is set to 1000000, and I still get the following error: 我的文件打开文件限制设置为1000000,但仍然出现以下错误:

file "/usr/lib/python2.7/socket.py", line 206, in accepterror: [Errno 24]  Too many open files

When I run sudo sysctl -p I get fs.file-max = 1000000 . 当我运行sudo sysctl -p我得到fs.file-max = 1000000

There is no way that limit was reached, because server was up and running for only 12 hours (100-200 sessions) 无法达到此限制,因为服务器仅启动并运行12个小时(100-200个会话)

What could be causing this error? 是什么导致此错误?

您可以通过lsof获得详细信息,以查看哪个processsocket用完了fd

Tried the solution of following StackOverflow topic ? 尝试了以下StackOverflow主题的解决方案?

socket.accept error 24: To many open files socket.accept错误24:到许多打开的文件

fs.file-max is a system-wide limit. fs.file-max是系统范围的限制。 There is also a per-process limit (much smaller by default, often 1024 or less). 每个进程还有一个限制(默认情况下小得多,通常为1024或更小)。 The per-process limit is controlled by /etc/security/limits.conf or the ulimit command. 每个进程的限制由/etc/security/limits.confulimit命令控制。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM