[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Alternative solution to stat storm problem
From: |
Farid Zakaria |
Subject: |
Alternative solution to stat storm problem |
Date: |
Mon, 3 Jan 2022 12:05:51 -0800 |
Hi!
I was very inspired by the blog post on a per-application
ld.so.conf.cache to solve the stat-storm problem[1].
I wanted to share here another approach I am pursuing and seek to
eventually try to merge into NixOS however I thought starting a
discussion here on Guix would be fruitful since it was the genesis of
the idea.
I have written a tool _shrinkwrap_ [2] that takes all transitive
dynamic shared object dependencies (only those listed in DT_NEEDED)
and turns them into an absolute path.
This has the same result as caching the entries and avoids the
unnecessary failed attempts at trying each RUNPATH entry.
Using the same demo application _emacs_ shows as much as well:
$strace -e openat,stat -c ./emacs_stamped --version
GNU Emacs 27.2
Copyright (C) 2021 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
100.00 0.000950 9 104 1 openat
------ ----------- ----------- --------- --------- ----------------
100.00 0.000950 9 104 1 total
$strace -e openat,stat -c
/nix/store/vvxcs4f8x14gyahw50ssff3sk2dij2b3-emacs-27.2/bin/.emacs-27.2-wrapped
--version
GNU Emacs 27.2
Copyright (C) 2021 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
100.00 0.034121 18 1823 1720 openat
------ ----------- ----------- --------- --------- ----------------
100.00 0.034121 18 1823 1720 total
Happy to hear some thoughts on this approach.
[1] https://guix.gnu.org/blog/2021/taming-the-stat-storm-with-a-loader-cache/
[2] https://github.com/fzakaria/shrinkwrap
- Alternative solution to stat storm problem,
Farid Zakaria <=