nixos/qemu-vm: Use disposable EROFS for store when writableStore = false#181746
Merged
roberth merged 4 commits intoNixOS:masterfrom Aug 14, 2022
Merged
nixos/qemu-vm: Use disposable EROFS for store when writableStore = false#181746roberth merged 4 commits intoNixOS:masterfrom
roberth merged 4 commits intoNixOS:masterfrom
Conversation
0b1dfa9 to
c8a495a
Compare
14 tasks
Member
Author
|
@ofborg test gitlab discourse simple installer.simple |
viraptor
reviewed
Jul 16, 2022
This avoids putting a large disk image in the store (and possibly in a binary cache), while improving runtime performance. Assuming you're running an SSD, and/or with plenty of cache (?) it is feasible to preempt the virtualization overhead before VM start, in single-digit seconds. For some tests that perform many reads on the store, the improved performance of EROFS is sufficient that not only the image creation overhead is compensated for, but is actually faster. Stats for nixosTests.gitlab: Baseline without useNixStoreImage: >1000s Baseline with useNixStoreImage without writableStore = false ext4 image in store: 277 seconds + significant image build time and/or disk space Disposable erofs image: 249 seconds _including_ image build time Custom erofs overlay on 9p host store: 391 seconds; presumably because the overlay still performs too many 9p accesses, or perhaps some other overhead. This solution had no obvious performance advantage, while requiring extra options to work, so it was discarded.
knedlsepp
reviewed
Aug 14, 2022
| for more frequent garbage collection. | ||
|
|
||
| If you really need this combination, you can set ${opt.writableStore} | ||
| explicitly to false, incur the cost and make this warning go away. |
Member
There was a problem hiding this comment.
I'm confused about the message. Shouldn't it say "explicitly to true"? This paragraph essentially says "set it to false to incur the cost, otherwise we recommend to set it to false", no?
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This avoids putting a large disk image in the store (and possibly
in a binary cache), while improving runtime performance.
Assuming you're running an SSD, and/or with plenty of cache (?)
it is feasible to preempt the virtualization overhead before
VM start, in single-digit seconds.
For some tests that perform many reads on the store, the improved
performance of EROFS is sufficient that not only the image creation
overhead is compensated for, but is actually faster.
Stats for nixosTests.gitlab:
Baseline without useNixStoreImage: >1000s
Baseline with useNixStoreImage without writableStore = false
ext4 image in store: 277 seconds
+ significant image build time and/or disk space
Disposable erofs image: 249 seconds including image build time
Custom erofs overlay on 9p host store: 391 seconds; presumably
because the overlay still performs too many 9p accesses, or perhaps
some other overhead. This solution had no obvious performance
advantage, while requiring extra options to work, so it was
discarded.
Description of changes
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes