Skip to content

Instantly share code, notes, and snippets.

@DennyLoko
Last active June 4, 2017 04:34
Show Gist options
  • Save DennyLoko/0dc342b76c1dfccb4b7e to your computer and use it in GitHub Desktop.
Save DennyLoko/0dc342b76c1dfccb4b7e to your computer and use it in GitHub Desktop.
#!/bin/sh -e
#/etc/rc.local
echo "1024" > /proc/sys/net/core/somaxconn
echo "1" > /proc/sys/net/ipv4/tcp_syncookies
echo "4096 87380 16777216" > /proc/sys/net/ipv4/tcp_rmem
echo "4096 65536 16777216" > /proc/sys/net/ipv4/tcp_wmem
echo "0" > /proc/sys/net/ipv4/tcp_timestamps
echo "30" > /proc/sys/net/ipv4/tcp_fin_timeout
echo "5" > /proc/sys/net/ipv4/tcp_keepalive_probes
echo "15" > /proc/sys/net/ipv4/tcp_keepalive_intvl
echo "16777216" > /proc/sys/net/core/wmem_max
echo "32784" > /proc/sys/net/core/netdev_max_backlog
echo "1" > /proc/sys/net/ipv4/tcp_syncookies
echo "1024 65535" > /proc/sys/net/ipv4/ip_local_port_range
echo "4096" > /proc/sys/net/ipv4/tcp_max_syn_backlog
echo "3221039" > /proc/sys/fs/file-max
echo "0" > /proc/sys/net/netfilter/nf_conntrack_checksum
echo "0" > /proc/sys/net/netfilter/nf_conntrack_events
echo "0" > /proc/sys/net/netfilter/nf_conntrack_acct
echo "500000" > /proc/sys/net/netfilter/nf_conntrack_max
echo "40000" > /sys/module/nf_conntrack/parameters/hashsize
echo "86400" > /proc/sys/net/netfilter/nf_conntrack_tcp_timeout_established
echo "3091639" > /proc/sys/kernel/threads-max
echo "4194304" > /proc/sys/kernel/pid_max
echo "600000" > /proc/sys/vm/max_map_count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment