Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

explore fuse optimizations #59

Open
4 of 9 tasks
stapelberg opened this issue Jan 28, 2020 · 1 comment
Open
4 of 9 tasks

explore fuse optimizations #59

stapelberg opened this issue Jan 28, 2020 · 1 comment
Labels
enhancement

Comments

@stapelberg
Copy link
Member

@stapelberg stapelberg commented Jan 28, 2020

jacobsa/fuse implements fuse 7.12. Current Linux kernels are at 7.31. Here are a few features which we should look into to possibly improve performance:

We should also figure out a representative benchmark for root file system performance.

We can use bpftrace to measure the number of FUSE calls during builds:

sudo bpftrace -e 'kprobe:fuse_simple_request { @[kstack(perf)] = count(); }'
@stapelberg stapelberg added the enhancement label Jan 28, 2020
@stapelberg
Copy link
Member Author

@stapelberg stapelberg commented Feb 9, 2020

AFAICT, building pkgs/linux looks bottlenecked on the distri fuse process. Maybe improvements can be measured by compiling pkgs/linux and measuring the time difference.

edit: gtk+-2 might be a better candidate, as it completes in ≈2 minutes instead of ≈10 minutes

stapelberg added a commit that referenced this issue Feb 15, 2020
The kernel treats a zero nodeid the same as ENOENT, but respects caching:

https://github.com/torvalds/linux/blob/2019fc96af228b412bdb2e8e0ad4b1fc12046a51/fs/fuse/dir.c#L353

This significantly reduces FUSE requests, e.g. during package builds:

before:
distri build -pkg=gtk+-2  438,42s user 160,10s system 569% cpu 1:45,12 total
distri build -pkg=gtk+-2  435,83s user 157,86s system 572% cpu 1:43,78 total

after:
distri build -pkg=gtk+-2  372,39s user 84,34s system 809% cpu 56,400 total
distri build -pkg=gtk+-2  373,22s user 85,02s system 812% cpu 56,366 total

related to #59
stapelberg added a commit that referenced this issue Feb 15, 2020
This is a pre-requisite for enabling symlink caching.

related to #59
stapelberg added a commit that referenced this issue Feb 15, 2020
before:
distri build -pkg=gtk+-2  372,39s user 84,34s system 809% cpu 56,400 total
distri build -pkg=gtk+-2  373,22s user 85,02s system 812% cpu 56,366 total
distri build -pkg=gtk+-2  372,37s user 84,20s system 809% cpu 56,378 total

with CacheSymlinks:
distri build -pkg=gtk+-2  368,58s user 80,63s system 829% cpu 54,134 total
distri build -pkg=gtk+-2  368,65s user 81,73s system 832% cpu 54,088 total
distri build -pkg=gtk+-2  368,43s user 82,23s system 832% cpu 54,113 total

related to #59
stapelberg added a commit that referenced this issue Feb 15, 2020
This means files in the page cache can be served by the kernel without having to
round-trip into userspace for OpenFile and OpenDir requests.

before:
distri build -pkg=gtk+-2  368,58s user 80,63s system 829% cpu 54,134 total
distri build -pkg=gtk+-2  368,65s user 81,73s system 832% cpu 54,088 total
distri build -pkg=gtk+-2  368,43s user 82,23s system 832% cpu 54,113 total

with OpenDir-less:
distri build -pkg=gtk+-2  367,24s user 82,04s system 828% cpu 54,253 total

with OpenFile-less:
distri build -pkg=gtk+-2  359,90s user 72,55s system 845% cpu 51,161 total
distri build -pkg=gtk+-2  359,90s user 72,55s system 845% cpu 51,161 total
distri build -pkg=gtk+-2  361,42s user 72,55s system 831% cpu 52,205 total

related to #59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement
Projects
None yet
Development

No branches or pull requests

1 participant