[erlang-questions] Low-latency Erlang

Joel Reymont <>
Fri Dec 29 12:00:33 CET 2006


Is Erlang suitable and optimized for writing low-latency networking  
code?

Are there examples of existing low-latency Erlang networking products?

I asked someone who implemented such code for advice and they  
suggested a few things which I will quote below...

"Make sure you avoid context-switches and lock contention if you want  
to have
optimum performance. Use scatter/gather I/O for sending bulk messages."

I see readv/writev used in the driver code, does this automatically  
extend to networking?

"Make sure that all system calls you perform assume bulk data.  Many  
mode switches to the kernel, e.g. if you perform a call for each  
message, will kill you."

Does this hold true for Erlang?

"I took real order traffic that we recorded, and played it through at  
normal and increased speeds.  Up to 20x - that was the maximum with a  
sustained rate of relaying (= reading + writing) ~10000 messages per  
second over true TCP/IP connections before too many messages exhibit  
critical latencies (> 30ms).  If you don't mind occasional spikes of  
a few hundred ms, you can go to almost 20000 messages per second."

This would not be an issue, would it? Something tells me that Erlang  
should be optimized for this type of work. I'm not sure about  
latency, though.

	Thanks, Joel

--
http://wagerlabs.com/








More information about the erlang-questions mailing list