unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Alternative solution to stat storm problem
@ 2022-01-03 20:05 Farid Zakaria
  2022-01-08 21:22 ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Farid Zakaria @ 2022-01-03 20:05 UTC (permalink / raw)
  To: guix-devel; +Cc: Scogland, Tom, Carlos Maltzahn

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-01-18 14:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-03 20:05 Alternative solution to stat storm problem Farid Zakaria
2022-01-08 21:22 ` Ludovic Courtès
2022-01-09  3:00   ` Farid Zakaria
2022-01-09  3:05     ` Farid Zakaria
2022-01-10 18:13       ` Tom Scogland
2022-01-18 14:00         ` Ludovic Courtès
2022-01-18 13:56     ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).