I just posted the third article about my comet experiments, which covers
why I needed to patch libevent to open >1M connections:

http://www.metabrew.com/article/a-million-user-comet-application-with-mochiweb-part-3/


On Tue, 2008-11-04 at 11:40 +0000, Richard Jones wrote:
> Hi,
> 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.
> 
> The ephemeral port allocator, which is used when you don't specify a
> local port numbebr, doesn't distinguish between local addresses though,
> so you need to specify the local port manually. 
> 
> 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.
> 
> Please find my patch attached - if there's svn/git/something repo I
> should patch against instead of the release tarball I would be happy to
> do so.
> 
> Thanks,
> RJ
> _______________________________________________
> Libevent-users mailing list
> Libevent-users@monkey.org
> http://monkeymail.org/mailman/listinfo/libevent-users
_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users

Reply via email to