[erlang-questions] Non-blocking send in erlang: how to save memory when send one content to many people

Max Lapshin max.lapshin@REDACTED
Wed Dec 14 23:48:11 CET 2011


I'm sending live stream to 4000+ users.

Stream is saved in memory (in shared ETS table, in binaries) in chunks
500 KBytes each.

Client comes and asks for next chunk.

If I write server in C (or with linked-in driver), I whould just
manage common shared circular buffer from which I will send data and
remember
client position in this buffer. If client is too slow to read from
this buffer, it is disconnected and forgotten.

Such approach give ability to save memory and not to copy it in
buffers and driver queues.

Is it possible to have something like this in erlang?

Currently, I've got limits around 3 GBit/s from one erlang node on
loopback interface and I want to raise this limit.
When traffic comes to this limit, memory begins very fast growing and
when it reaches limits of RAM, massive disconnects happen.
This is why I think, that I should save memory first without trying to
write linked-in tcp driver =)



More information about the erlang-questions mailing list