20k messages in 4s but want to go faster!

Jim Morris <>
Mon Jul 13 09:58:15 CEST 2009


I think it is actually faster. My server uses a gen_fsm for each
socket/client connection. When I get a message that needs broadcasting/
unicasting to all the other clients, I get a list of all the PIDS of
the gen_fsm's, and send an erlang message to each of the pids, when
the 8,000 or so gen_fsm processes get that message they do a tcp send
to their client. That is getting the fastest throughput for me.

Also if you do a tcp send from different processes to the same socket
you will get contention, and no guaranteed order, just an FYI.
So in my system whenever one client needs to send a TCP message to
another client, it is always done through the clients FSM process.

The whole reason for me using Erlang was that I could do one process
per socket, as processes were so cheap.

On Jul 13, 12:35 am, Joel Reymont <> wrote:
> On Jul 13, 2009, at 7:22 AM, Rapsey wrote:
>
> > But you definitely should be using process per socket model.
>
> Why?
>
> ---
> Mac hacker with a performance benthttp://www.linkedin.com/in/joelreymont
>
> ________________________________________________________________
> erlang-questions mailing list. Seehttp://www.erlang.org/faq.html
> erlang-questions (at) erlang.org


More information about the erlang-questions mailing list