473,473 Members | 1,807 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Re: SocketServer max connections

Guilherme Polo wrote:
On Mon, Aug 25, 2008 at 7:20 AM, Ken Seehart <ke*@seehart.comwrote:
>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_size 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.SOMAXCONN value, but depending on your system you can set a
number much higher than that one given by socket.SOMAXCONN.
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

Aug 27 '08 #1
0 1390

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Olivier Hoarau | last post by:
Hello, I have build a client/server application with the socket module. The server mades UDP broadcasting and the client only reads UDP broadcast messages. All work fine. Now I want to use for...
0
by: Adil Hasan | last post by:
Hello Fred, I just ran across your question. I think that the following code will work: ----- SERVER CODE ------ import SocketServer import time class...
12
by: rbt | last post by:
I have written a python socketServer program and I have a few questions that I hope the group can answer... here is a simple version of the server: class...
1
by: rbt | last post by:
I've read more about sockets and now, I have a better understanding of them. However, I still have a few SocketServer module questions: When used with SocketServer how exactly does...
14
by: Stuart | last post by:
I need to write a socket server that accepts around 100 connections, but this could grow to a 1000, or more in time. The data throughput will be minimal, mostly in short random bursts, but it's...
0
by: Tomi Hautakoski | last post by:
Hello, I'm a Python newbie trying to figure out how to use SocketServer with IPv6. I would like to set up a TCPServer working like below but how to tell SocketServer I need to use AF_INET6? ...
0
by: Ken Seehart | last post by:
I apologize if this message is a repeat. It looks like didn't get received. I'm using SocketServer to implement a local server that serves comet long-polling connections. How do I increase...
0
by: Guilherme Polo | last post by:
On Mon, Aug 25, 2008 at 7:20 AM, Ken Seehart <ken@seehart.comwrote: You need to change request_queue_size in your subclass, supposing you are directly or indirectly using a tcp server. The...
1
by: Okko Willeboordse | last post by:
Hello, SocketServer.ThreadingTCPServer accepts connections (clients can connect) before and after it's server_forever method is called, see below for an example. IMHO it should only accept...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.