-2

I'm testing out IPFS on NixOS and I'm seeing errors due to "too many open files" in the journalctl -u ipfs logs. ulimit -n shows the limit on the number of open files is set at 1024. How do I increase the file descriptor limit in configuration.nix?

Bill
  • 518
  • 5
  • 10

1 Answers1

3

I was able to increase the number of open files by adding the following to configuration.nix.

  security.pam.loginLimits = [{
    domain = "*";
    type = "soft";
    item = "nofile";
    value = "8192";
  }];

After running nixos-rebuild switch and reboot, ulimit -n reported 8192.

More specifically, it's also possible to limit the number of file handles used by the IPFS service by adding the following to configuration.nix.

services.ipfs.serviceFdlimit = 32768;
Bill
  • 518
  • 5
  • 10