[erlang-questions] Re: Unicast 20k messages, $500-$1000 bounty

Joel Reymont joelr1@REDACTED
Fri Jul 17 14:13:08 CEST 2009

Can we have a final expert word on this from the OTP team?

Must we use a middleman process or can we combine {delay_send, true}  
with directly sending to the socket when unicasting to 20k clients?

Are there other tweaks to apply apart from raising priority to high  
around the broadcasting ets:foldr?

This dispute must be settled as soon as possible for the benefit of  
future generations!

On Jul 17, 2009, at 11:35 AM, Sverker Eriksson wrote:

> Joel Reymont wrote:
>> Since the result of gen_tcp:send is ignored in the broadcasting  
>> loop, perhaps erlang:port_command can be used directly on the  
>> socket to make things completely asynchronous and avoid the need  
>> for a middleman process.
>> I think solid proof is needed here rather than speciluation.
> Calling erlang:port_command directly will not make things completely  
> asyncronous. The inet driver will suspend the calling process when  
> the send queue has reached its high watermark. You will block in  
> erlang:port_command until some sending has succeeded and the send  
> queue is below a low watermark. Or you can timeout using option  
> send_timeout.

Mac hacker with a performance bent

More information about the erlang-questions mailing list