[erlang-questions] Send message to thousands of clients
Wed Nov 24 21:27:41 CET 2010
I remember some benchmark case where the idea was to raise the sender's priority with process_flag(priority, low | normal | high | max). Raise it as much as needed when sending (max should usually be kept for erts processes), and then turn it back to normal as soon as you're done; raising the priority to high should ideally be for short periods of time.
On 2010-11-24, at 15:16 PM, Max Lapshin wrote:
> 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?
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:
More information about the erlang-questions