Re: [Libevent-users] Patch: evhttp_connection_set_local_port
On Tue, 2008-11-04 at 16:12 +, Niels Provos wrote: On Tue, Nov 4, 2008 at 3:40 AM, Richard Jones [EMAIL PROTECTED] wrote: In order to open more than 2^16 connections (HTTP connections in my case) *from* one machine, you need to use multiple local IPs, because the maximum local port number is 65536. evhttp_connection_set_local_address already exists and is suitable for this. Your assessment seems not quite correct. TCP connections are identified by their 4-tuple (src ip, src port, dst ip, dst port). So, the 2^16 port limitation comes into play only if you are opening connections to the same IP address. If you talk to multiple different IP addresses, port reuse is not a problem. Niels. Not sure I follow - I'm trying to open 1M connections from one machine to another machine. Only 2 machines are involved, and i'm only concerned with the client machine - the server already exists. Given that part of that 4-tuple is a local ip/port pair, I assumed you'd be limited to 2^16 connections from one local ip, because of the limit on port numbers? RJ ___ Libevent-users mailing list Libevent-users@monkey.org http://monkeymail.org/mailman/listinfo/libevent-users
Re: [Libevent-users] Patch: evhttp_connection_set_local_port
On Tue, 2008-11-04 at 04:04 -0800, Dan Kegel wrote: On Tue, Nov 4, 2008 at 3:40 AM, Richard Jones [EMAIL PROTECTED] wrote: I added evhttp_connection_set_local_port, which in conjunction with evhttp_connection_set_local_address and some tcp/kernel tuning allowed me to open 1 million http connections from one machine. I brought up 16 IPs and opened 62,500 from each. Just shy of C1M! I'd like to see how well that performs... - Dan I wasn't sure if C1000K sounded better ;) I'm 90% finished writing up my findings as Part 3 to my comet series on www.metabrew.com - it turns out that my client process (C+libevent with my patch) that opens 1M connections takes 2.1GB resident once all 1M connections are established. With my (slightly uninformed) tcp/kernel tuning to make it possible, the box is actually consuming close to 10GB though. So it looks like 8GB is consumed by the kernel/tcp stack to maintain the connections, which seems a bit high - but I have no basis for comparison. RJ ___ Libevent-users mailing list Libevent-users@monkey.org http://monkeymail.org/mailman/listinfo/libevent-users
Re: [Libevent-users] Patch: evhttp_connection_set_local_port
On Tue, Nov 4, 2008 at 4:16 AM, Richard Jones [EMAIL PROTECTED] wrote: I'm 90% finished writing up my findings as Part 3 to my comet series on www.metabrew.com - it turns out that my client process (C+libevent with my patch) that opens 1M connections takes 2.1GB resident once all 1M connections are established. With my (slightly uninformed) tcp/kernel tuning to make it possible, the box is actually consuming close to 10GB though. So it looks like 8GB is consumed by the kernel/tcp stack to maintain the connections, which seems a bit high - but I have no basis for comparison. Yeah, why would two pages be allocated per connection if there is no network traffic going on? It would be fun if somebody tracked down that overhead and reduced it. Once you write up your findings, you might want to post a question about that on lkml. C1000K / C1M in the subject line might get some attention :-) ___ Libevent-users mailing list Libevent-users@monkey.org http://monkeymail.org/mailman/listinfo/libevent-users