Created
September 24, 2014 09:08
-
-
Save cuixin/8c913566ca72d2c9d6ac to your computer and use it in GitHub Desktop.
resolve Linux "Too many files open" error
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
#/etc/security/limits.conf | |
* hard nofile 1024000 | |
* soft nofile 1024000 | |
root hard nofile 1024000 | |
root soft nofile 1024000 |
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
#/etc/sysctl.conf | |
fs.file-max = 1024000 | |
net.ipv4.tcp_tw_reuse = 1 | |
net.ipv4.tcp_keepalive_time = 600 | |
net.ipv4.tcp_fin_timeout = 30 | |
net.ipv4.tcp_max_tw_buckets = 5000 | |
net.ipv4.ip_local_port_range = 1024 61000 | |
net.ipv4.tcp_rmem = 4096 32768 262142 | |
net.ipv4.tcp_wmem = 4096 32768 262142 | |
net.core.netdev_max_backlog = 8096 | |
net.core.rmem_default = 262144 | |
net.core.wmem_default = 262144 | |
net.core.rmem_max = 2097152 | |
net.core.wmem_max = 2097152 | |
net.ipv4.tcp_syncookies = 1 | |
net.ipv4.tcp_max_syn_backlog = 1024 | |
# sudo sysctl -p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment