Skip to content

Instantly share code, notes, and snippets.

@voyeg3r
Last active September 14, 2019 10:29
Show Gist options
  • Save voyeg3r/368407 to your computer and use it in GitHub Desktop.
Save voyeg3r/368407 to your computer and use it in GitHub Desktop.
desempenho de reded
# /etc/sysctrl.conf
# references:
# https://klaver.it/linux/sysctl.conf
# https://wiki.archlinux.org/index.php/Sysctl
# wget -c https://raw.github.com/gist/368407/ -O - > /etc/sysctrl.conf
# ( O O )
# +===========oOO==(_)==OOo==============+
# | |
# | °v° Sergio Luiz Araujo Silva |
# | /(_)\ Linux User #423493 |
# | ^ ^ voyeg3r  gmail.com |
# +======================================+
# This file should be saved as /etc/sysctl.conf and can be activated using the command:
# sysctl -e -p /etc/sysctl.conf
# http://www.ubuntu-unleashed.com/2008/04/howto-harden-ubuntu-linux-kernel-with.html
# https://klaver.it/linux/sysctl.conf
# http://www.webhostingtalk.com/showthread.php?t=257654
# After you make the changes to the file, you can make them effective immediately by typing in /sbin/sysctl -p
# source: http://www.ubuntu-unleashed.com/2008/04/howto-harden-ubuntu-linux-kernel-with.html
# http://www.cyberciti.biz/faq/linux-tcp-tuning/
net.core.rmem_default = 524288
net.core.rmem_max = 524288
net.core.wmem_default = 524288
net.core.wmem_max = 524288
net.core.optmem_max = 57344
net.core.netdev_max_backlog = 5000
#net.ipv4.tcp_wmem = 4096 87380 524288
#net.ipv4.tcp_rmem = 4096 87380 524288
net.ipv4.tcp_rmem= 10240 87380 12582912
net.ipv4.tcp_wmem= 10240 87380 12582912
net.ipv4.tcp_mem = 524288 524288 524288
net.ipv4.tcp_rfc1337 = 1
net.ipv4.ip_no_pmtu_disc = 1
net.ipv4.tcp_sack = 1
net.ipv4.tcp_fack = 1
net.ipv4.tcp_max_syn_backlog = 1024
net.ipv4.tcp_max_tw_buckets = 1440000
# Disable TCP timestamp support to reduce CPU use
net.ipv4.tcp_timestamps = 0
# reuse/recycle time-wait sockets
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
# Enable TCP SYN Cookie Protection
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_ecn = 0
net.ipv4.route.flush = 1
net.ipv4.ipfrag_high_thresh = 512000
net.ipv4.ipfrag_low_thresh = 446464
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_no_metrics_save = 1
# # Set maximum amount of memory allocated to shm to 512MB
kernel.shmmax= 134217728
kernel.shmall=2097152
# Enable ignoring broadcasts request
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6=1
# Do less swapping
vm.swappiness=10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
vm.vfs_cache_pressure=50
# Increase number of incoming connections
net.core.somaxconn = 32768
# Keep at least 32MB of free RAM space available
vm.min_free_kbytes = 32768
## disable ALL packet forwarding (not a router, disable it)
net.ipv4.ip_forward = 0
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.all.secure_redirects = 0
# increase system file descriptor limit
# fs.file-max = 65535
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment