]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: ring: add support for a backing-file
authorWilly Tarreau <w@1wt.eu>
Thu, 11 Aug 2022 14:38:20 +0000 (16:38 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 12 Aug 2022 09:18:46 +0000 (11:18 +0200)
commit0b8e9ceb12ee7ba5f5d3fada2610920a97014dc8
treee17a2f6c1084174bd218a3cd1c03717df5ac4756
parent6df10d872b84121b4d0e1fbd7bf91fd8defb3680
MINOR: ring: add support for a backing-file

This mmaps a file which will serve as the backing-store for the ring's
contents. The idea is to provide a way to retrieve sensitive information
(last logs, debugging traces) even after the process stops and even after
a possible crash. Right now this was possible by connecting to the CLI
and dumping the contents of the ring live, but this is not handy and
consumes quite a bit of resources before it is needed.

With a backing file, the ring is effectively RAM-mapped file, so that
contents stored there are the same as those found in the file (the OS
doesn't guarantee immediate sync but if the process dies it will be OK).

Note that doing that on a filesystem backed by a physical device is a
bad idea, as it will induce slowdowns at high loads. It's really
important that the device is RAM-based.

Also, this may have security implications: if the file is corrupted by
another process, the storage area could be corrupted, causing haproxy
to crash or to overwrite its own memory. As such this should only be
used for debugging.
doc/configuration.txt
include/haproxy/sink-t.h
src/sink.c