5 ms·
is there somewhere where there is a comparison of the performance between active and passive mode? I don't imagine it to be significant for most use cases, so
by dnautics 5y ago
is there somewhere where there is a comparison of the performance between active and passive mode? I don't imagine it to be significant for most use cases, so the extra safety seemed worth it to me in all the libraries I wrote, though I suppose it wouldn't be hard to rewrite those with {active, 1}.
- devoutsalsa 5y agoUsing active mode is a nice because you can receive other messages as well, instead of blocking to receive just a tcp message. I like active once myself.
- dnautics 5y agoyou can time out your recv, even with the value 0!
- crazydoggers 5y agoRanch is a pretty well optimized and battle hardened tcp acceptor. It powers the Cowboy/Phoenix server which scales to extreme level of concurrency and low latency. Cowboy uses ranch to pool and accept connections and I believe it uses {active,once}. https://github.com/ninenines/cowboy https://github.com/ninenines/cowboy https://github.com/ninenines/ranch https://github.com/ninenines/ranch
- latch 5y agohttps://stressgrid.com/blog/cowboy_performance_part_2/ https://stressgrid.com/blog/cowboy_performance_part_2/ Might be interesting. Amongst other things, they experimented with a patch to Cowboy to use {active, 100} instead of the default {active, 1} and got some nice wins.