From c6fe1512d6e859a48f218d25d726ad2835730c7e Mon Sep 17 00:00:00 2001 From: Eduard Toloza Date: Fri, 9 Aug 2019 00:32:07 -0500 Subject: [PATCH] Added files --- etc/sysctl.d/80-network-tuning.conf | 76 ++++++++++++++++++++++++++ etc/sysctl.d/90-vm-tuning.conf | 5 ++ etc/udev/rules.d/60-ioschedulers.rules | 2 + etc/udev/rules.d/69-hdparm.rules | 1 + etc/udev/udev.conf | 10 ++++ 5 files changed, 94 insertions(+) create mode 100644 etc/sysctl.d/80-network-tuning.conf create mode 100644 etc/sysctl.d/90-vm-tuning.conf create mode 100644 etc/udev/rules.d/60-ioschedulers.rules create mode 100644 etc/udev/rules.d/69-hdparm.rules create mode 100644 etc/udev/udev.conf diff --git a/etc/sysctl.d/80-network-tuning.conf b/etc/sysctl.d/80-network-tuning.conf new file mode 100644 index 0000000..63c0920 --- /dev/null +++ b/etc/sysctl.d/80-network-tuning.conf @@ -0,0 +1,76 @@ +# Disable Explicit Congestion Notification in TCP +net.ipv4.tcp_ecn=0 + +# window scaling +net.ipv4.tcp_window_scaling=1 + +# increase linux autotuning tcp buffer limits +net.ipv4.tcp_rmem=8192 87380 16777216 +net.ipv4.tcp_wmem=8192 65536 16777216 + +# increase TCP max buffer size +net.core.rmem_max=16777216 +net.core.wmem_max=16777216 + +# Increase number of incoming connections backlog +net.core.netdev_max_backlog=16384 +net.core.dev_weight=64 + +# Increase number of incoming connections +net.core.somaxconn=32768 + +# Increase the maximum amount of option memory buffers +net.core.optmem_max=65535 + +# Increase the tcp-time-wait buckets pool size to prevent simple DOS attacks +net.ipv4.tcp_max_tw_buckets=1440000 + +# try to reuse time-wait connections, but don't recycle them (recycle can break clients behind NAT) +net.ipv4.tcp_tw_reuse=1 + +# Limit number of orphans, each orphan can eat up to 16M (max wmem) of unswappable memory +net.ipv4.tcp_max_orphans=16384 +net.ipv4.tcp_orphan_retries=0 + +# don't cache ssthresh from previous connection +net.ipv4.tcp_no_metrics_save=1 +net.ipv4.tcp_moderate_rcvbuf=1 + +# Increase size of RPC datagram queue length +net.unix.max_dgram_qlen=50 + +# Don't allow the arp table to become bigger than this +net.ipv4.neigh.default.gc_thresh3=2048 + +# Tell the gc when to become aggressive with arp table cleaning. +# Adjust this based on size of the LAN. 1024 is suitable for most /24 networks +net.ipv4.neigh.default.gc_thresh2=1024 + +# Adjust where the gc will leave arp table alone - set to 32. +net.ipv4.neigh.default.gc_thresh1=32 + +# Adjust to arp table gc to clean-up more often +net.ipv4.neigh.default.gc_interval=30 + +# Increase TCP queue length +net.ipv4.neigh.default.proxy_qlen=96 +net.ipv4.neigh.default.unres_qlen=6 + +# Enable Explicit Congestion Notification (RFC 3168), disable it if it doesn't work for you +net.ipv4.tcp_ecn=1 +net.ipv4.tcp_reordering=3 + +# How many times to retry killing an alive TCP connection +net.ipv4.tcp_retries2=15 +net.ipv4.tcp_retries1=3 + +# Avoid falling back to slow start after a connection goes idle +# keeps our cwnd large with the keep alive connections (kernel > 3.6) +net.ipv4.tcp_slow_start_after_idle=0 + +# Allow the TCP fastopen flag to be used, beware some firewalls do not like TFO! (kernel > 3.7) +net.ipv4.tcp_fastopen=3 + +# This will enusre that immediatly subsequent connections use the new values +net.ipv4.route.flush=1 +net.ipv6.route.flush=1 diff --git a/etc/sysctl.d/90-vm-tuning.conf b/etc/sysctl.d/90-vm-tuning.conf new file mode 100644 index 0000000..6ac3ea5 --- /dev/null +++ b/etc/sysctl.d/90-vm-tuning.conf @@ -0,0 +1,5 @@ +vm.swappiness=10 +vm.vfs_cache_pressure=10 +vm.dirty_background_ratio=50 +vm.dirty_ratio=80 +vm.page-cluster=16 diff --git a/etc/udev/rules.d/60-ioschedulers.rules b/etc/udev/rules.d/60-ioschedulers.rules new file mode 100644 index 0000000..51d5c0d --- /dev/null +++ b/etc/udev/rules.d/60-ioschedulers.rules @@ -0,0 +1,2 @@ +# set scheduler for rotating disks +ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="bfq" diff --git a/etc/udev/rules.d/69-hdparm.rules b/etc/udev/rules.d/69-hdparm.rules new file mode 100644 index 0000000..135913d --- /dev/null +++ b/etc/udev/rules.d/69-hdparm.rules @@ -0,0 +1 @@ +ACTION=="add", SUBSYSTEM=="block", KERNEL=="sda", RUN+="/usr/bin/hdparm -B 254 -S 0 /dev/sda" diff --git a/etc/udev/udev.conf b/etc/udev/udev.conf new file mode 100644 index 0000000..7deb771 --- /dev/null +++ b/etc/udev/udev.conf @@ -0,0 +1,10 @@ +# see udev.conf(5) for details +# +# udevd is also started in the initrd. When this file is modified you might +# also want to rebuild the initrd, so that it will include the modified configuration. + +#udev_log=info +#children_max= +#exec_delay= +#event_timeout=180 +#resolve_names=early