Once you pass a certain point (about 150k connections) in our tests, the CPU system percentage goes through the roof. This is because the kernel has to switch to some different port allocation algorithm which uses O(n) searching rather than efficient searching. Apologies this is a bit vague but I can't fully remember from a month or two back when we were doing this. However this all gets resolved by adding the IP_BIND_ADDRESS_NO_PORT option to socket creation, then we can scale to a million tcp/xmpp connections per tsung box.
Rough patches as follows, although we did not fully test the SSL one:
Once you pass a certain point (about 150k connections) in our tests, the CPU system percentage goes through the roof. This is because the kernel has to switch to some different port allocation algorithm which uses O(n) searching rather than efficient searching. Apologies this is a bit vague but I can't fully remember from a month or two back when we were doing this. However this all gets resolved by adding the
IP_BIND_ADDRESS_NO_PORT
option to socket creation, then we can scale to a million tcp/xmpp connections per tsung box.Rough patches as follows, although we did not fully test the SSL one: