The `buffer` socket option will be changed dynamically based on how much data is received. This is restricted to AMQP protocols (old and 1.0). The algorithm is a little different than Cowboy 2.13. The moving average is less reactive (div 8 instead of 2) and floats are used so that using smaller lower buffer values is possible (otherwise the rounding prevents increasing buffer sizes). The lower buffer size was set to 128 as a result. Compared to the previous which was to set `buffer` to `rcvbuf` effectively, often to 131072 on Linux for example, the performance sees a slight improvement in various scenarios for all message sizes using AMQP-0.9.1 and a lower memory usage as well. But the difference is small in the benchmarks we have run (5% to 10%), whereas Cowboy saw a huge improvement because its default was very small (1460). For AMQP-1.0 this seems to be no worse but we didn't detect a clear improvement. We saw scenarios where small message sizes showed improvement, and large message sizes showed a regression. But we are even less confident with these results. David (AMQP-1.0 native developer) ran a few tests and didn't see a regression. The dynamic buffer code is currently identical for old and 1.0 AMQP. But we might tweak them differently in the future so they're left as duplicate for now. This is because different protocols have different behaviors and so the algorithm may need to be tweaked differently for each protocol. |
||
---|---|---|
.. | ||
amqqueue.hrl | ||
amqqueue_v2.hrl | ||
internal_user.hrl | ||
mc.hrl | ||
rabbit_amqp.hrl | ||
rabbit_amqp_metrics.hrl | ||
rabbit_amqp_reader.hrl | ||
rabbit_global_counters.hrl | ||
rabbit_khepri.hrl | ||
vhost.hrl | ||
vhost_v2.hrl |