[erlang-questions] Unicorn-style load balancing in Erlang?

Daniel Goertzen <>
Wed Jan 2 22:25:22 CET 2013


For bare acceptor pool libraries, take a look at...

https://github.com/extend/ranch
https://github.com/jeremey/swarm

And I would bet that most significant socket server apps written in Erlang
would use acceptor pooling of some sort.

Dan.

On Wed, Jan 2, 2013 at 10:09 AM, Xiao Jia <> wrote:

> From http://www.erlang.org/doc/man/gen_tcp.html#accept-1:
>
> > It is worth noting that the accept call does not have to be issued
> > from the socket owner process. Using version 5.5.3 and higher of
> > the emulator, multiple simultaneous accept calls can be issued
> > from different processes, which allows for a pool of acceptor
> > processes handling incoming connections.
>
> Does it mean that we can have Unicorn-style load balancing in Erlang?
> If so, are there any existing servers or libraries making use of this
> feature?
>
> For those who are not familiar with Unicorn [1], it is a traditional
> UNIX prefork web server. Load balancing between worker processes is
> done by the OS kernel. All workers share a common set of listener
> sockets and does non-blocking accept() on them. The kernel will decide
> which worker process to give a socket to and workers will sleep if
> there is nothing to accept().
>
> btw, I also posted this question on StackOverflow [2] but no active
> responses there :-(
>
> [1]: http://unicorn.bogomips.org/
> [2]:
> http://stackoverflow.com/questions/14121987/unicorn-style-load-balancing-in-erlang
>
> ---
> Regards,
> Xiao Jia
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130102/0a1167a4/attachment.html>


More information about the erlang-questions mailing list