Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lacoski/3e0ee45d4276be9d6dca689366197026 to your computer and use it in GitHub Desktop.
Save lacoski/3e0ee45d4276be9d6dca689366197026 to your computer and use it in GitHub Desktop.
increase max number of ulimit open file and max user processes in Linux.
1- Step : open the sysctl.conf and add this line fs.file-max = 65536
vi /etc/sysctl.conf add end of line
fs.file-max=500000
save and exit.
2. Step : vi /etc/security/limits.conf and add below the mentioned
* soft nproc 500000
* hard nproc 500000
* hard nofile 500000
* soft nofile 500000
root hard nofile 500000
root soft nofile 500000
jetadmin hard nofile 500000
jetadmin soft nofile 500000
nginx hard nofile 500000
nginx soft nofile 500000
and vi /etc/security/limits.d/90-nproc.conf
* soft nproc 500000
* hard nproc 500000
* soft nofile 500000
* hard nofile 500000
save and exit
3. Step - pam-limits
vi /etc/pam.d/common-session
Add following line at the end of the file:
session required pam_limits.so
save and exit
4. Reboot ubuntu server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment