rabbitmq-server/deps/rabbit/include
Loïc Hoguin 53444107b5
Add dynamic buffer functionality to rabbit_reader
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.
2025-02-27 12:46:28 +01:00
..
amqqueue.hrl Bump (c) line year 2025-01-01 17:54:10 -05:00
amqqueue_v2.hrl Change repo "root" to deps/rabbit 2020-11-13 14:34:42 +01:00
internal_user.hrl Khepri migration: match expected records 2023-10-30 09:09:53 +01:00
mc.hrl Fix dead lettering 2024-05-13 11:00:39 +02:00
rabbit_amqp.hrl Support AMQP over WebSocket (OSS part) 2025-01-27 17:50:47 +01:00
rabbit_amqp_metrics.hrl Support AMQP over WebSocket (OSS part) 2025-01-27 17:50:47 +01:00
rabbit_amqp_reader.hrl Add dynamic buffer functionality to rabbit_reader 2025-02-27 12:46:28 +01:00
rabbit_global_counters.hrl Support AMQP 1.0 natively 2024-02-28 14:15:20 +01:00
rabbit_khepri.hrl rabbit_khepri: Add macros for path patterns 2024-11-22 11:21:11 -05:00
vhost.hrl Remove pre-virtual_host_metadata feature flag compatibility code 2022-08-01 11:56:04 +02:00
vhost_v2.hrl Change repo "root" to deps/rabbit 2020-11-13 14:34:42 +01:00