Send message to thousands of clients
Wed Nov 24 21:16:35 CET 2010
I remember, that there was such a discussion, but can't find it.
So, I have a problem: about 40 times per second process ems_media gets
a frame, performs some actions and then retransmit it up to 1500
clients and more.
Problem is in bad responsiveness of this process. Clients cannot wait
when it reply for some tasks such as unsubscribe, etc.
Simple benchmarks shows that
[Pid ! Message || Pid <- List]
can take upto 13 milliseconds when List length is 2000.
Question is: what should I do?
Current idea is to create 5-10 retransmit processes, that will store
about 100-300 of pids each and ems_media will send frames only to
them. After that, these processes, each on separate core, will send
messages to clients.
Or there is a better idea?
More information about the erlang-questions