Author neologix
Recipients neologix, pitrou, sbt, vstinner
Date 2014-05-13.04:50:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
> On Windows, it's not the best choice to use this hardcoded limit. socket.SOMAXCONN is 2^31-1.

I don't see what this would bring: 128 *is* a reasonable limit.

> listen() documentation says that Windows chooses a reasonable backlog value for you if you pass SOMAXCONN:
> You should maybe use SOMAXCONN by default on Windows, and Py_MIN(SOMAXCONN, 128) by default on other platforms (UNIX).

Trying to come up with a good heuristic is a lost battle, since it
depends not only on the OS but also the application.  The goal is to
have a default value that works, is large enough to avoid connection
drops in common use cases, and not too large to avoid resource

> 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):

In theory we could use net.core.somaxconn sysctl & Co (that's what go
does), but IMO it's overkill.
Date User Action Args
2014-05-13 04:50:45neologixsetrecipients: + neologix, pitrou, vstinner, sbt
2014-05-13 04:50:45neologixlinkissue21455 messages
2014-05-13 04:50:45neologixcreate