Skip to content

Instantly share code, notes, and snippets.

@cryptocode
Last active March 17, 2021 16:14
Show Gist options
  • Save cryptocode/5e0e5447a0a804597d041c997323e3cd to your computer and use it in GitHub Desktop.
Save cryptocode/5e0e5447a0a804597d041c997323e3cd to your computer and use it in GitHub Desktop.

Increasing max open file descriptors on a Droplet w/Ubuntu

Add session required pam_limits.so to these two files:

/etc/pam.d/common-session
/etc/pam.d/common-session-noninteractive

Next, edit /etc/security/limits.conf

... and add the following lines:

* soft nofile 20000
* hard nofile 30000
root hard nofile 16384
root soft nofile 16384

The last two lines can be skipped if you're not running the node as root.

Log out and back in or reboot and see if ulimit -n picked it up

On some systems, you may need to change systemd files, etc.

Docker

Once the host is updated, pass --ulimit nofile=16384:16384

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment