您的服务器套接字侦听积压限制为100个连接 [英] Your server socket listen backlog is limited to 100 connections

查看:310
本文介绍了您的服务器套接字侦听积压限制为100个连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在uwsgi上运行了flask应用程序.我使用主管来管理uwsgi进程.我发现日志中说

I run a flask app on uwsgi. I use supervisor to manage uwsgi process. I find the log saying that

您的服务器套接字侦听积压限制为100个连接.

your server socket listen backlog is limited to 100 connections.

如何克服100个连接限制? 我正在运行的脚本如下:

How to overcome 100 connections limitation? My running script is as below:

[program:myapp]
command=uwsgi --master -s /tmp/app.sock --module myapp:app --processes 2 -H /srv/sites/mysite chmod-socket 666 --enable-threads

推荐答案

请注意,监听积压"的100个连接并不意味着您的服务器只能处理100个同时(或总计)连接-这取决于配置的进程或线程的数量.侦听积压是一个套接字设置,它告诉内核如何限制侦听套接字的侦听队列中未完成(尚未启用)的连接数.如果挂起的连接数超过指定的大小,则新连接将被自动拒绝.正常运行的服务器定期为其连接提供服务,不需要大量积压.

Note that a "listen backlog" of 100 connections doesn't mean that your server can only handle 100 simultaneous (or total) connections - this is instead dependent on the number of configured processes or threads. The listen backlog is a socket setting telling the kernel how to limit the number of outstanding (as yet unaccapted) connections in the listen queue of a listening socket. If the number of pending connections exceeds the specified size, new ones are automatically rejected. A functioning server regularly servicing its connections should not require a large backlog size.

根据手册,您可以使用-l选项更改监听积压:

According to the manual, you can change the listen backlog with the -l option:

-l|--listen <num>
       set  socket  listen queue to <n> (default 100, maximum is system
       dependent)

这篇关于您的服务器套接字侦听积压限制为100个连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆