sudo vim /etc/security/limits.confec2-user soft nofile 65536
ec2-user hard nofile 65536
root soft nofile 65536
root hard nofile 65536vim ~/.bashrcsudo 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-maxLogoff and login again in SSH.
ulimit -n