Collecting my attempts to improve at tech, art, and life

Dealing with "too many open files" on Linux

ulimit shows the maximum number of files you can open. Use -S to see the soft limit.

ulimit -S -n
1024

And -H for the hard limit

ulimit -H -n
1048576

Increase the soft limit — up to your hard limit — for the current session.

ulimit -n 2048

To permanently change file limits

Edit /etc/systemd/system.conf

DefaultLimitNOFILE=4096:1048576

Then /etc/systemd/user.conf

DefaultLimitNOFILE=4096:1048576

Apply the change with Systemd

sudo systemctl daemon-reexec

Added to vault 2024-06-15. Updated on 2024-06-15