Questions about available space for a sandbox build

I’ve some build errors due to the sandbox not being big enough.
Finding where the builds are done was surprisingly hard but i finally stumbled upon nix.conf
which says

This option determines the maximum size of the tmpfs filesystem mounted on /dev/shm in Linux sandboxes. For the format, see the description of the size option of tmpfs in mount8. The default is 50%.

I believe the mount8 is not properly displayed (mount(8) ?!).
So now I am trying to understand what is a good value for sandbox-dev-shm-size.
When I look at man tmpfs it says:

The size may also have a % suffix to limit this instance to a percentage of physical RAM.
              The default, when neither size nor nr_blocks is specified, is size=50%.

I’ve tried setting sandbox-dev-shm-size to 100% and rebooted the nix-daemon. Seems like it didn’t change a think in the size of /dev/shm. Looks like it’s expected as /dev/shm is a (optional) linux thing : Linux - Shared Memory (SHM) (/dev/shm)
So now I wonder how to increase the size for the nix build:

  1. can I increase the size of the shared memory via boot.devShmSize ? (do i need to reboot)
  2. if I set sandbox-dev-shm-size to 100% do I starve other processes potentially ? how dangerous can it be ?
  3. what if I set sandbox-dev-shm-size to a size > /dev/shm size ? e.g. 300GB . Is it capped to /dev/shm size ?


Hosted by Flying Circus.