Maximum TCP Server Connections

fumanchu fumanchu at amor.org
Sat Feb 10 11:40:58 EST 2007


On Feb 10, 4:52 am, Steve Holden <s... at holdenweb.com> wrote:
> Sorry this question isn't strictly Python-related. Does any one know how
> many simultaneous TCP connections it's practical to expect a TCP-based
> server application to support (on the OS of your choice)? I'm looking
> for the restrictions imposed by the operating environment rather than
> the application itself.

Data point:

When using winsock2, the number of simultaneous TCP connections is
limited by the FD_SETSIZE preprocessor constant, which is often 64. It
must be set before including winsock2.h. See Google and http://
www.aminus.org/blogs/index.php/fumanchu/2006/12/23/
cherrypy_3_has_fastest_wsgi_server_yet#c38647

Note also that many TCP servers use one thread per child socket, in
which case you can hit a memory limit. IIRC, each Python thread on
Windows uses a 1 MB stack: http://mail.python.org/pipermail/python-
win32/2005-June/003346.html


Robert Brewer
System Architect
Amor Ministries
fumanchu at amor.org




More information about the Python-list mailing list