Created
April 9, 2012 20:04
-
-
Save tovbinm/2346230 to your computer and use it in GitHub Desktop.
Increase ulimit
This file contains hidden or 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
1. | |
# vim /etc/sysctl.conf | |
fs.file-max = 999999 | |
net.ipv4.tcp_rmem = 4096 4096 16777216 | |
net.ipv4.tcp_wmem = 4096 4096 16777216 | |
net.ipv4.ip_local_port_range = 1024 65535 | |
2. | |
# vim /etc/security/limits.conf | |
root - nofile 999999 | |
root soft nofile 999999 | |
root hard nofile 999999 | |
#(on a regular linux: * - nofile 999999) | |
3. | |
# vim /etc/pam.d/common-session | |
session required pam_limits.so | |
Reboot & Verify your settings: | |
# sysctl -p && cat /proc/sys/fs/file-max && ulimit -n | |
Consider increasing the following: | |
net.ipv4.tcp_max_syn_backlog | |
net.core.somaxconn | |
And decreasing 'vm.swappiness' to 5 |
This file contains hidden or 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
echo "fs.file-max = 999999" >> /etc/sysctl.conf | |
echo "net.ipv4.tcp_rmem = 4096 4096 16777216" >> /etc/sysctl.conf | |
echo "net.ipv4.tcp_wmem = 4096 4096 16777216" >> /etc/sysctl.conf | |
echo "net.ipv4.ip_local_port_range = 1024 65535" >> /etc/sysctl.conf | |
echo "net.ipv4.tcp_fin_timeout = 15" >> /etc/sysctl.conf | |
echo "root - nofile 999999" >> /etc/security/limits.conf | |
echo "root soft nofile 999999" >> /etc/security/limits.conf | |
echo "root hard nofile 999999" >> /etc/security/limits.conf | |
echo "session required pam_limits.so" >> /etc/pam.d/common-session |
This file contains hidden or 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
1. launchctl limit maxfiles 999999 999999 | |
2. Restart you Mac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
More here:
http://research.cs.wisc.edu/condor/condorg/linux_scalability.html
http://urbanairship.com/blog/2010/09/29/linux-kernel-tuning-for-c500k/
http://wwwx.cs.unc.edu/~sparkst/howto/network_tuning.php
http://sys-notes.com/bin/view/Main/LinuxKernelOomKiller