]> git.ipfire.org Git - thirdparty/elfutils.git/commit
PR31265 - rework debuginfod archive-extract fdcache
authorFrank Ch. Eigler <fche@redhat.com>
Fri, 9 Feb 2024 00:33:55 +0000 (19:33 -0500)
committerFrank Ch. Eigler <fche@redhat.com>
Tue, 13 Feb 2024 16:43:36 +0000 (11:43 -0500)
commitacd9525e93d75d6f0e34c9302051cfebbb8f783f
treee145f655ff99c1042dd99787f93592a0f961d7a0
parentadd63e0317b6e27dd4077b19e998e6c56a3becb5
PR31265 - rework debuginfod archive-extract fdcache

Completely replace the "fdcache" algorithms in debuginfod, which
manages files extracted from archives.  Previous logic was a LRU queue
for files requested by users, and a separate LRU queue for prefetched
files found nearby the ones users requested.  The code did not handle
annoying edge cases like infrequently accessed but very costly
extraction of files like fedora kernels' vdso.debug.  In addition, the
queue was searched linearly for normal lookups.  It was also
unceremoniously dropped at each groom cycle.

New code replaces this with an indexed datastructure for quick
lookups, and extra metadata for use during eviction decisions.  Each
entry tracks size and such, but now also tracks how recently and how
many times it was requested, how long it took to originally extract.
The new code combines these quantities in a score, by which eviction
eligibility is ranked.  Intuitively, the effect is to prefer to hoard
small / slow-to-access files, and prefer to jettison large / fast /
never accessed ones.

It's a tricky thing to balance.  The parameters in this configuration
were tested by timing-accurate replaying a few days' worth of actual
traffic of the main fedora debuginfod server.  The peer
debuginfod.stg.fedoraproject.org runs the new code.  It shows good
performance, excellent use of the cache storage, and strong preference
to hold onto those vdso.debug files.  But who knows, it might need
tweaking later.  The new code adds more prometheus metrics to make it
possible to grok the effectiveness of the few remaining
fdcache-related options.

Patch includes doc updates and NEWS.  The changes are invisible to the
testsuite (except with respect to the new metrics).  Code changes are
focused on all the member functions of class libarchive_fdcache, and
their callers.  Unused parameters are removed, with previous command
line options hidden/accepted/ignored.  Some other minor error-path
tempfile-gc was fixed in the extraction paths.

Signed-Off-By: Frank Ch. Eigler <fche@redhat.com>
NEWS
debuginfod/debuginfod.cxx
doc/debuginfod.8