You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains 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
This file contains 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
Without adjusting file-max, logLimits, and service limits in vmtest.nix
[vm@test-nixos:~]$ print-file-limits
RLIMIT_NOFILE soft(1024) hard(524288)
[vm@test-nixos:~]$ journalctl -u print-file-limits --no-pager -e
-- Logs begin at Tue 2019-11-12 17:00:52 UTC, end at Tue 2019-11-12 17:23:53 UTC. --
Nov 12 17:23:32 test-nixos systemd[1]: Starting print-file-limits.service...
Nov 12 17:23:32 test-nixos print-file-limits[549]: RLIMIT_NOFILE soft(1024) hard(524288)
Nov 12 17:23:32 test-nixos systemd[1]: print-file-limits.service: Succeeded.
Nov 12 17:23:32 test-nixos systemd[1]: Started print-file-limits.service.
Note that soft and hard limits match between service and user process.
After adjusting file-max and logLimits in vmtest.nix
[vm@test-nixos:~]$ print-file-limits
RLIMIT_NOFILE soft(8192) hard(8192)
[vm@test-nixos:~]$ journalctl -u print-file-limits.service --no-pager -e
-- Logs begin at Tue 2019-11-12 17:00:52 UTC, end at Tue 2019-11-12 17:31:30 UTC. --
Nov 12 17:30:36 test-nixos systemd[1]: Starting print-file-limits.service...
Nov 12 17:30:36 test-nixos print-file-limits[548]: RLIMIT_NOFILE soft(1024) hard(524288)
Nov 12 17:30:36 test-nixos systemd[1]: print-file-limits.service: Succeeded.
Nov 12 17:30:36 test-nixos systemd[1]: Started print-file-limits.service.
Note that soft and hard limits don't match between service and user process.
This confirms that file-max and logLimits do not affect service file limits.
After adjusting file-max, logLimits, and service limits in vmtest.nix
[vm@test-nixos:~]$ cat /etc/systemd/system.conf
[Manager]
DefaultCPUAccounting=yes
DefaultBlockIOAccounting=yes
DefaultIOAccounting=yes
DefaultBlockIOAccounting=yes
DefaultIPAccounting=yes
DefaultLimitCORE=infinity
DefaultLimitNOFILE=128K:512K
[vm@test-nixos:~]$ print-file-limits
RLIMIT_NOFILE soft(8192) hard(8192)
[vm@test-nixos:~]$ journalctl -u print-file-limits.service --no-pager -e
-- Logs begin at Tue 2019-11-12 17:00:52 UTC, end at Tue 2019-11-12 17:59:18 UTC. --
Nov 12 17:57:56 test-nixos systemd[1]: Starting print-file-limits.service...
Nov 12 17:57:56 test-nixos print-file-limits[542]: RLIMIT_NOFILE soft(1024) hard(524288)
Nov 12 17:57:56 test-nixos systemd[1]: print-file-limits.service: Succeeded.
Nov 12 17:57:56 test-nixos systemd[1]: Started print-file-limits.service.
Despite setting DefaultLimitNOFILE, the RLIMIT for print-file-limits.service did not change.
Not sure what is required here.
Change service limit to local option. Also bump service hard limit to 1M.
[vm@test-nixos:~]$ journalctl -u print-file-limits.service --no-pager -e
-- Logs begin at Tue 2019-11-12 17:00:52 UTC, end at Tue 2019-11-12 18:41:56 UTC. --
Nov 12 18:41:35 test-nixos print-file-limits[555]: RLIMIT_NOFILE soft(1024) hard(524288)
[vm@test-nixos:~]$ grep NOFILE /etc/systemd/system/print-file-limits.service
LimitNOFILE=125K:1M
[vm@test-nixos:~]$ cat /etc/systemd/system.conf
[Manager]
DefaultCPUAccounting=yes
DefaultBlockIOAccounting=yes
DefaultIOAccounting=yes
DefaultBlockIOAccounting=yes
DefaultIPAccounting=yes
DefaultLimitCORE=infinity
Still no change in RLIMITS reported by print-file-limits.service.
[vm@test-nixos:~]$ journalctl -u print-file-limits.service -n 5 --no-pager
-- Logs begin at Tue 2019-11-12 17:00:52 UTC, end at Tue 2019-11-12 20:36:04 UTC. --
Nov 12 20:35:43 test-nixos print-file-limits[518]: RLIMIT_NOFILE soft(125000) hard(1000000)
RLIMITS for print-file-limits.service now reflect the settings in the service file.
This file contains 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