Skip to content

Instantly share code, notes, and snippets.

@diegopacheco
Last active October 23, 2020 02:16
Show Gist options
  • Save diegopacheco/127b5c6cfb716779dd73533d56dc08d7 to your computer and use it in GitHub Desktop.
Save diegopacheco/127b5c6cfb716779dd73533d56dc08d7 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