LINUX – Network Throughput Tuning
General Approach
To check what setting your system is using, use ‘sysctl name’ (e.g.: ‘sysctl net.ipv4.tcp_rmem’). To change a setting use ‘sysctl -w’. To make the setting permanent add the setting to the file ‘sysctl.conf’.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
cho > /etc/sysctl.conf echo -e "\ # /etc/sysctl.conf \r # ---------------- BEGIN ---------------- \r # to load new settings \r # sysctl --load /etc/sysctl.conf \r # \r ### TCP tuning \r # \r # For hosts with 10G NIC optimized for network paths up to 200ms RTT, or a 40G NIC up on paths up to 50ms RTT \r # allow testing with 512MB buffers \r net.core.rmem_max = 536870912 \r net.core.wmem_max = 536870912 \r # \r # increase Linux autotuning TCP buffer limits \r # min, default, and max number of bytes to use \r # allow auto-tuning up to 128MB buffers \r net.ipv4.tcp_rmem = 4096 87380 268435456 \ net.ipv4.tcp_wmem = 4096 65536 268435456 \r # \r # recommended to increase this for CentOS6 with 10G NICS or higher \r net.core.netdev_max_backlog = 250000 \r # \r # don't cache ssthresh from previous connection \r net.ipv4.tcp_no_metrics_save = 1 \r # \r # recommended default congestion control is htcp \r # test with 'sysctl net.ipv4.tcp_available_congestion_control' net.ipv4.tcp_congestion_control = reno \r # \r # recommended for hosts with jumbo frames enabled \r net.ipv4.tcp_mtu_probing = 1 \r # \r # recommended for CentOS7/Debian8 hosts \r net.core.default_qdisc = fq \r # \r fs.inotify.max_user_watches = 100000 \r #\r # --------------- END ------------------" \ > /etc/sysctl.conf cat /etc/sysctl.conf sysctl --load /etc/sysctl.conf sysctl -p |
More Reading: