Skip to content

Instantly share code, notes, and snippets.

@hellolucky
Forked from ben-lin/max_open_file
Created September 7, 2012 03:32
Show Gist options
  • Select an option

  • Save hellolucky/3662839 to your computer and use it in GitHub Desktop.

Select an option

Save hellolucky/3662839 to your computer and use it in GitHub Desktop.
Configure max open file
## Configure max open file
ref : [nodejs.production](https://github.com/dreamerslab/nodejs.production), only `nodejs` user can open more files
$ sudo su
$ echo "nodejs soft nofile 51200" >> /etc/security/limits.conf
$ echo "nodejs hard nofile 51200" >> /etc/security/limits.conf
$ echo "www-data hard nofile 51200" >> /etc/security/limits.conf
$ echo "www-data hard nofile 51200" >> /etc/security/limits.conf
$ echo "session required pam_limits.so" >> /etc/pam.d/common-session
$ exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment