英文:
actix-web error accepting connection: Too many open files (os error 24)
问题
我正在使用 actix-web 作为一个HTTP服务器,通常每12秒会有大约200个请求。在最初的几个请求之后,我一直不断地收到这个错误消息:[2023-07-23T07:39:48Z ERROR actix_server::accept] error accepting connection: Too many open files (os error 24)
。
我尝试增加连接数限制使用 ulimit
命令,并尝试修改 Actix 的 max_connection
配置,但这两种方法都没有帮助。
我正在使用的 actix 版本是 actix-web = "4.3.1"
,当前的 ulimit -n
值为 1000
,并且在一台具有以下规格的服务器上运行:
英文:
I am using actix-web for an HTTP server, it usually has about 200 requests per 12 seconds, After the first few requests I am continuously getting this error
[2023-07-23T07:39:48Z ERROR actix_server::accept] error accepting connection: Too many open files (os error 24)
I tried increasing the connection using ulimit
and also tried changing the max_connection
configurations of Actix. But this did not help either.
i am using actix version actix-web = "4.3.1"
and the current ulimit -n
value is 1000
. and running on a server with spec
答案1
得分: 1
以下是翻译好的内容:
可能有其他进程打开了许多文件句柄?
以下是一些建议,可能会指出导致问题的原因。
列出所有打开的文件描述符:
ls -l /proc/$$/fd
你可能想尝试设置一个比1000更大的限制,看看是否有所帮助:
ulimit -n 15000
你可以使用 ss 命令来获得关于系统上正在发生的情况的更多见解(套接字统计)。例如,使用以下命令:
ss -s
英文:
Could there be some other process with many open file handles?
Here are a few tips that might point you to what is causing the problem.
To list all open file descriptors:
ls -l /proc/$$/fd
You might want to try setting a larger (than 1,000) limit and see if that helps:
ulimit -n 15000
You could use the ss command to gain more insight into what's happening on your system (socket statistics). For example, with this command:
ss -s
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论