dnsdist: Add per-backend `max_udp_outstanding` YAML config setting
This commit adds a new per-backend config setting `max_udp_outstanding`
which overrides the global `tuning.udp.max_outstanding_per_backend`
setting.
If the per-backend `max_udp_outstanding` setting is omitted, the value
of the global option `tuning.udp.max_outstanding_per_backend` will be
used instead.
This allows tuning the number of UDP states allocated on a per-backend
basis in order to tune the amount of memory consumed by dnsdist.
Low-latency backends may only need a small number of UDP states, while
high-latency backends may need a higher number of UDP states.
The `tuning.udp.max_outstanding_per_backend` setting and the new
per-backend `max_udp_outstanding` setting directly control the sizes of
the vectors of `IDState` objects that are preallocated at startup.
The size of the `IDState` object can vary depending on compile time
options, but in my local build it is currently 496 bytes. This means
that a backend with the maximum number of UDP states (65535) will
require allocating at least (496 * 65535 /
1048576) = 31 MB. Similarly,
a backend with 8192 UDP states will require allocating 3.9 MB, and a
backend with 256 UDP states only requires 124 KB.
Signed-off-by: Robert Edmonds <edmonds@users.noreply.github.com>