[Twisted-Python] Twisted TCP Server Maximum Simultaneous Connections
First of all, I want to send my gratitude to the people who developed Twisted. ^_^ We have this XMPP server that is implemented using twisted (using the epoll reactor). I was tasked to know how many simultaneous connections it can handle. So I wrote an XMPP benchmark tool using twisted that spawns multiple clients. When we used the benchmark tool on two PCs (each spawning 20,000 XMPP clients), the number of successful connect/authorize varies between 37,000~39,000. Adding more clients we get the, "Connection Closed cleanly" error on the XMPP server. Spawning two XMPP servers didn't help to increase the simultaneous connections. Did we hit the ceiling? Or is there anyway we can increase this further? We already configured the ulimit parameters and tinkered with some kernel configurations.
On Tue, 2007-06-05 at 21:15 -0400, Alvin Delagon wrote:
When we used the benchmark tool on two PCs (each spawning 20,000 XMPP clients), the number of successful connect/authorize varies between 37,000~39,000.
Did we hit the ceiling? Or is there anyway we can increase this further? We already configured the ulimit parameters and tinkered with some kernel configurations.
There's no limits in Twisted itself that would cause that, so it's likely in the kernel. For example - You may have the free TCP port limit range, since you are doing so many connections from only two IP addresses. This is not a limit that would affect you during production, of course; you could see if you can get higher numbers of connections with more client machines. -- Itamar Shtull-Trauring http://itamarst.org
Hello, To chip in my two cents - try testing with more machines, as Itamar had suggested earlier. It is very easy to max out the limits of the testing machines before the server is maxed out. I think there is a kernel parameter that specifies low and high ports of outgoing connections. Try with more machines. On Wed, 2007-06-06 at 10:01 -0400, Itamar Shtull-Trauring wrote:
On Tue, 2007-06-05 at 21:15 -0400, Alvin Delagon wrote:
When we used the benchmark tool on two PCs (each spawning 20,000 XMPP clients), the number of successful connect/authorize varies between 37,000~39,000.
Did we hit the ceiling? Or is there anyway we can increase this further? We already configured the ulimit parameters and tinkered with some kernel configurations.
There's no limits in Twisted itself that would cause that, so it's likely in the kernel. For example -
You may have the free TCP port limit range, since you are doing so many connections from only two IP addresses. This is not a limit that would affect you during production, of course; you could see if you can get higher numbers of connections with more client machines.
On Tue, 2007-06-05 at 21:15 -0400, Alvin Delagon wrote:
First of all, I want to send my gratitude to the people who developed Twisted. ^_^
We have this XMPP server that is implemented using twisted [..]
Oh, that is very interesting as I am working on this in my sandbox for a while now. Could you expand on that and is the code available? -- Groetjes, ralphm
Thanks for the suggestions. I'll test the benchmark script on four PC's and update this thread for the results. @ Ralph Sorry, I don't know if I have the right to provide the source for the twisted XMPP server since it's not written by me. On 6/6/07, Ralph Meijer <twisted@ralphm.ik.nu> wrote:
On Tue, 2007-06-05 at 21:15 -0400, Alvin Delagon wrote:
First of all, I want to send my gratitude to the people who developed Twisted. ^_^
We have this XMPP server that is implemented using twisted [..]
Oh, that is very interesting as I am working on this in my sandbox for a while now. Could you expand on that and is the code available?
-- Groetjes,
ralphm
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
participants (4)
-
Alvin Delagon
-
Itamar Shtull-Trauring
-
Konrads Smelkovs
-
Ralph Meijer