-
-
Save alienmaster9/d96f475bcf579daa23705f28141d8b98 to your computer and use it in GitHub Desktop.
Set Permanently ulimit -n / open files in ubuntu
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
# available limit | |
user@ubuntu:~$ ulimit -n | |
1024 | |
# To increase the available limit to say 65535 | |
user@ubuntu:~$ sudo nano /etc/sysctl.conf | |
# add the following line to it | |
fs.file-max = 1024576 | |
sudo vim /etc/security/limits.conf | |
# add following lines to it | |
* soft nproc 1024576 | |
* hard nproc 1024576 | |
* soft nofile 1024576 | |
* hard nofile 1024576 | |
root soft nproc 1024576 | |
root hard nproc 1024576 | |
root soft nofile 1024576 | |
root hard nofile 1024576 | |
# edit the following file | |
user@ubuntu:~$ sudo nano /etc/pam.d/common-session | |
# add this line to it | |
session required pam_limits.so | |
# run this to refresh with new config | |
user@ubuntu:~$ sudo sysctl -p | |
# logout and login and try the following command | |
user@ubuntu:~$ ulimit -n | |
1024576 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment