Re: SocketServer max connections

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Laszlo Nagy

    Re: SocketServer max connections

    Guilherme Polo wrote:
    On Mon, Aug 25, 2008 at 7:20 AM, Ken Seehart <ken@seehart.co mwrote:
    >
    >I'm using SocketServer to implement a local server that serves comet
    >long-polling connections.
    >>
    >How do I increase the maximum number of open connections? Currently it is
    >limited to about 8 I think. More than that and it seems to block on opening
    >more connections until one of the other connections releases.
    >>
    >
    You need to change request_queue_s ize in your subclass, supposing you
    are directly or indirectly using a tcp server.
    The default is 5, rather low. The first attempt you can do is using
    the socket.SOMAXCON N value, but depending on your system you can set a
    number much higher than that one given by socket.SOMAXCON N.
    >
    Also be aware that "request_queue_ size" determines the max. number of
    incoming connections that are waiting in a queue to be accepted by the
    server. After the server calls accept() on the server socket, the
    connection is removed from the queue and a new client socket is created.
    The actual communication is done through the client socket(s). The
    number of open client sockets is independent of the request queue size.
    In other words, if you accept incoming connections instantly and then
    process clients in parallel, then probably you do not need to increase
    the queue size. (Maybe you already knew that?)

    Best,

    Laszlo

Working...