Skip to content

Instantly share code, notes, and snippets.

@AlexVKO
Forked from diegopacheco/aws-linux-ulimit.md
Created October 17, 2017 06:05
Show Gist options
  • Save AlexVKO/1b6c7df44bbe152ca25dfe7e30b21f3f to your computer and use it in GitHub Desktop.
Save AlexVKO/1b6c7df44bbe152ca25dfe7e30b21f3f to your computer and use it in GitHub Desktop.
How to Set ulimit on amazon linux | CentOS based?
sudo vim /etc/security/limits.conf
ec2-user soft nofile 65536
ec2-user hard nofile 65536

root soft nofile 65536
root hard nofile 65536
vim ~/.bashrc
sudo sysctl -w net.ipv4.ip_local_port_range="1025 65535"
echo 300000 | sudo tee /proc/sys/fs/nr_open
echo 300000 | sudo tee /proc/sys/fs/file-max

Logoff and login again in SSH.

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