Last active
June 21, 2017 06:35
-
-
Save girvan/a341513654ad6b1cbb7f365b9f68fa7b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if grep -q 32768 /etc/security/limits.conf; then | |
echo skip /etc/security/limits.conf; | |
else | |
echo "* hard nofile 32768" | sudo tee -a /etc/security/limits.conf | |
echo "* soft nofile 32768" | sudo tee -a /etc/security/limits.conf | |
echo "root hard nofile 65536" | sudo tee -a /etc/security/limits.conf | |
echo "root soft nofile 65536" | sudo tee -a /etc/security/limits.conf | |
fi | |
if grep -q net.core.somaxconn /etc/sysctl.conf; then | |
echo skip /etc/sysctl.conf; | |
else | |
echo "net.core.somaxconn = 65536" | sudo tee -a /etc/sysctl.conf | |
fi | |
echo "reload settings"; | |
sudo sysctl -p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Verify the new ulimit / files open settings
It's worth noting that ubuntu 16.04+ now has much higher defaults
So you only need a single line for the soft limits