The configuration options nix.daemonNiceLevel and nix.daemonIONiceLevel have no observable effect on my machine: nixos-unstable at 15.06pre64030.e1af50c.
They should cause the systemd service options Nice and IOSchedulingPriority to be set. Is that not the case?
I don't see anything like that:
# cat /etc/systemd/system/nix-daemon.service
[Unit]
Description=Nix Daemon
RequiresMountsFor=/nix/store
RequiresMountsFor=/nix/var
ConditionPathIsReadWrite=/nix/var/nix/daemon-socket
[Service]
ExecStart=@/nix/store/xf667rba4zrg3iwfl7hn8caf2kjjwn4a-nix-1.9pre4153_b64988b/bin/nix-daemon nix-daemon --daemon
KillMode=process
The nix-daemon process certainly isn't running with nice level 20, like I configured.
Check /etc/systemd/system/nix-daemon.service.d/overrides.conf.
And systemctl show nix-daemon to see the effective values.
I have:
# cat /etc/systemd/system/nix-daemon.service.d/overrides.conf
[Unit]
X-Restart-Triggers=/nix/store/kl32yasr5l32cp0imk1nsx702jh4zfgz-nix.conf
[Service]
Environment="CURL_CA_BUNDLE=/etc/ssl/certs/ca-bundle.crt"
Environment="LOCALE_ARCHIVE=/nix/store/6s0bj21hi3lg3y1n0qsir1xzq00jx6yw-glibc-locales-2.21/lib/locale/locale-archive"
Environment="NIX_CONF_DIR=/etc/nix"
Environment="NIX_OTHER_STORES=/run/nix/remote-stores/*/nix"
Environment="PATH=/nix/store/xf667rba4zrg3iwfl7hn8caf2kjjwn4a-nix-1.9pre4153_b64988b/bin:/nix/store/zzjmzg5xpns5mcnj01ss6qsd4yj706zh-openssl-1.0.1m/bin:/nix/store/hbfqrxx5qfgqmpg0j393k39z3c6807dj-util-linux-2.26.2/bin:/nix/store/2fllrnbvy3a5zmwwz01il15r2fsbg4wv-openssh-6.8p1/bin:/nix/store/bnlcsbw7nhd21vw4xssnxwi9y7h2asjj-coreutils-8.23/bin:/nix/store/43msgvphrf68r6vk8jmqwz2b1vfi3w9z-findutils-4.4.2/bin:/nix/store/yg3d4qnyvb74b4hmw4484cicwk0r74yn-gnugrep-2.21/bin:/nix/store/50lmmxx9rynhbndaacwds8g99fgdjz7m-gnused-4.2.2/bin:/nix/store/zlq94gj8mdb1vxpvwh7vzjm6c24y75rz-systemd-217/bin:/nix/store/xf667rba4zrg3iwfl7hn8caf2kjjwn4a-nix-1.9pre4153_b64988b/sbin:/nix/store/zzjmzg5xpns5mcnj01ss6qsd4yj706zh-openssl-1.0.1m/sbin:/nix/store/hbfqrxx5qfgqmpg0j393k39z3c6807dj-util-linux-2.26.2/sbin:/nix/store/2fllrnbvy3a5zmwwz01il15r2fsbg4wv-openssh-6.8p1/sbin:/nix/store/bnlcsbw7nhd21vw4xssnxwi9y7h2asjj-coreutils-8.23/sbin:/nix/store/43msgvphrf68r6vk8jmqwz2b1vfi3w9z-findutils-4.4.2/sbin:/nix/store/yg3d4qnyvb74b4hmw4484cicwk0r74yn-gnugrep-2.21/sbin:/nix/store/50lmmxx9rynhbndaacwds8g99fgdjz7m-gnused-4.2.2/sbin:/nix/store/zlq94gj8mdb1vxpvwh7vzjm6c24y75rz-systemd-217/sbin"
Environment="TZDIR=/nix/store/sqy08f8alilmm33fsbfjjr91f080cbdm-tzdata-2015d/share/zoneinfo"
IOSchedulingPriority=7
LimitNOFILE=4096
Nice=20
But:
# systemctl show nix-daemon | egrep -i 'nice|schedu'
LimitNICE=0
Nice=0
IOScheduling=16391
CPUSchedulingPolicy=0
CPUSchedulingPriority=0
CPUSchedulingResetOnFork=no
I screwed up: I assigned niceness "20", which is invalid. Changing that value to "19" remedied the issue.
Most helpful comment
I screwed up: I assigned niceness "20", which is invalid. Changing that value to "19" remedied the issue.