[issue21455] add default backlog to socket.listen()

STINNER Victor report at bugs.python.org
Tue May 13 00:18:22 CEST 2014


STINNER Victor added the comment:

An article suggests to use max(1024, socket.SOMAXCONN) (to "listen() backlog as large as possible") instead of socket.SOMAXCONN because the OS maximum can be larger than SOMAXCONN (and that it's not possible in Python to get the OS value):
http://utcc.utoronto.ca/~cks/space/blog/python/AvoidSOMAXCONN?showcomments#comments

The following article tries to explain why the default limit is 128 on Linux:
https://derrickpetzold.com/p/somaxconn/

Article giving the value chosen by Windows when SOMAXCONN is passed: it depends on the Windows version (between 5 and 50, hard limit of 200 on Windows 7):
http://stackoverflow.com/questions/4709756/listen-maximum-queue-size-per-windows-version

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21455>
_______________________________________


More information about the Python-bugs-list mailing list