News for hackers. Stuff that matters.
Re:Facebook Chat Architecture (Erlang) by cgbystrom on Monday December 13, 2010 @11:40AM (#2000990)
It turns out that Java synchronizes on accept() capping the number of socket accepts that can made each second on a single port.

But even if that would be solved or if you used something more low-level like, say nginx, you'd still be limited of how fast you can accept().

Try using ApacheBench and hit one server with keep-alive on and off respectively. Even nginx, which I would say is a performant web server, show quite some discrepancies between having to reconnect each time and having a permanent connection.

I file this under the penalty of having to set up and tear down a socket each time. Something that only can be avoided by doing less reconnecting.

I could of course be wrong but these are the findings from doing performance testing and discussing it on the Netty mailing list. But I'd gladly accept suggestions on how to improve this situation for our service.

Re:Facebook Chat Architecture (Erlang) by axod on Monday December 13, 2010 @12:20PM (#2001152)
I'd personally start by not using Netty if you have the time to start from scratch :/
Re:Facebook Chat Architecture (Erlang) by cgbystrom on Monday December 13, 2010 @12:34PM (#2001229)
Netty is not the problem. Java NIO has that limitation. And performance isn't in any way bad, just that there's more to extract (I believe).
Re:Facebook Chat Architecture (Erlang) by axod on Monday December 13, 2010 @02:29PM (#2001656)
> "Netty is not the problem. Java NIO has that limitation."

As I say, I'd be interested in numbers to back that up. It's certainly not a limitation I've noticed.