Allow configuring niceness, ionice and similar settings for builders #1096
Labels
No labels
Affects/CppNix
Affects/Nightly
Affects/Only nightly
Affects/Stable
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/lix ci
Area/nix-eval-jobs
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/repl/debugger
Area/store
awaiting
author
awaiting
contributors
bug
Context
contributors
Context
drive-by
Context
maintainers
Context
RFD
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
Feature/S3
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
ux
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lix-project/lix#1096
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Is your feature request related to a problem? Please describe.
I alias
verynicetoschedtool -B -n 15 -e ionice -c3(SCHED_BATCH, nice level of 15, "idle" IO scheduling class), which is useful to preserve system interactivity during long builds that hammer the CPU.It's difficult to do this for unprivileged builds through the lix daemon.
Describe the solution you'd like
Options to set at least the properties supported by schedtool and ionice (from util-linux):
Describe alternatives you've considered
Although one could set these properties on the daemon itself, this feels incorrect and not very flexible. The daemon is also not used for builds invoked by root (e.g., nixos-rebuild).
Additional context
N/A
this is completely impossible in lix itself today due to protocol limitations, and it'll be Quite Some Time before we're in a place that would allow us to do this. setting the options on the daemon itself (or the systemd units, as nixos does by default to some extent) is the best thing we can offer today. with the
cgroupsexperimental feature enabled you can also have a monitor running in the background that manipulates lix cgroups depending on how long a build have been active.Fair enough, this is far from urgent and a reasonable workaround exists.
@pennae wrote in #1096 (comment):
I'm not familiar with the internals at all. Out of curiosity, what's the limitation here?
communicating literally anything to the daemon that isn't part of our established (and, for now, frozen) wire protocol, for example scheduling configuration for builds started by a specific client instance. we can't change it because that'd make us incompatible with cppnix including remote build servers and clients, so changing that is a a no go. a new rpc protocol is in the works though, and once that's done we can properly reconsider something like this
Ah right, thanks for explaining. Maybe I didn't explain my request very well.
I was expecting a set of nix.conf options, which unless I'm mistaken the daemon reads itself so this shouldn't be a problem? Lix already adds some of those (such as temp-dir), and they can also be overridden with
--option(this is currently the only way to limit the number of cores used by a build at runtime, so it would at least be consistent), but I have no idea how this interacts with the protocol.every
--optionthat passes from the cli to the daemon must go through the protocol, so we can't change the set of options the daemon sees for now. we could add some options to nix.conf that can't be overridden by clients, but at that point we're just badly reimplementing systemd :(we also want more flexible resource configuration, scheduling options, monitorin, etc. it's on the list, but we won't get there very soon
alright that makes perfect sense, thanks again!