This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
100g_tuning [2023/07/27 21:24] root created |
100g_tuning [2023/07/28 17:15] (current) root |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ==100Gbit Ethernet Tuning== | + | `==100Gbit Ethernet Tuning== |
- | A summary of internet resources. | + | A summary of internet resources. |
[[https:// | [[https:// | ||
Line 10: | Line 10: | ||
[[https:// | [[https:// | ||
- | [[https:// | + | [[https:// |
- | [[https:// | + | [[https:// |
[[https:// | [[https:// | ||
Line 20: | Line 20: | ||
[[ https:// | [[ https:// | ||
+ | [[ https:// | ||
+ | |||
+ | === What PerfSonar does automatically === | ||
+ | |||
+ | < | ||
+ | net.core.rmem_max = 536870912 | ||
+ | net.core.wmem_max = 536870912 | ||
+ | net.ipv4.conf.all.arp_announce = 2 | ||
+ | net.ipv4.conf.all.arp_filter = 1 | ||
+ | net.ipv4.conf.all.arp_ignore = 1 | ||
+ | net.ipv4.conf.default.arp_filter = 1 | ||
+ | net.ipv4.tcp_congestion_control = htcp | ||
+ | net.ipv4.tcp_mtu_probing = 1 | ||
+ | net.ipv4.tcp_no_metrics_save = 1 | ||
+ | net.ipv4.tcp_rmem = 4096 87380 268435456 | ||
+ | net.ipv4.tcp_wmem = 4096 65536 268435456 | ||
+ | |||
+ | ifconfig ens16f1 mtu 9000 | ||
+ | </ | ||
+ | |||
+ | ==Redhat 1== | ||
+ | |||
+ | < | ||
+ | |||
+ | net.ipv4.tcp_window_scaling = 1 | ||
+ | net.ipv4.tcp_rmem = 8192 x 4194304 | ||
+ | net.ipv4.tcp_wmem = 8192 Y 4194304 | ||
+ | The middle value Y is the default buffer size. This is the most important value. You might wish to start at 524288 (512kb) and move up from there. You will generally wish to try small increments of your Bandwidth Delay Product. Try BDP x1 then BDP x1.25 then BDP x1.5 and so on. Once you start to get increased speeds, you may wish to refine your testing down smaller, for example BDP x2.5 then BDP x2.6 and so on. It is unlikely you will need a value larger than BDP x5. | ||
+ | </ | ||
+ | |||
+ | ==NVidia== | ||
+ | |||
+ | This is windows so requires translation | ||
+ | |||
+ | < | ||
+ | Disable SACK | ||
+ | Enable Fast Datagram UDP | ||
+ | Set RSS=enabled | ||
+ | Set closest NUMA | ||
+ | Set receive buffers=512 | ||
+ | Set send buffers=2048 | ||
+ | IPV4 Checksum offload enabled | ||
+ | TCP/UDP Checksum offload enabled | ||
+ | IPV6 TCP/UDP Checksum offload enabled | ||
+ | Large Send Option offload enabled | ||
+ | </ | ||
+ | |||
+ | ==BBR== | ||
+ | |||
+ | Enable TCP/BBR congestion control. See BBR and Redhat-3 above. | ||
+ | |||
+ | echo " | ||
+ | |||
+ | ==Stanford== | ||
+ | |||
+ | < | ||
+ | |||
+ | firewall-cmd --zone=public --add-port=61617/ | ||
+ | firewall-cmd --zone=public --add-port=8090/ | ||
+ | firewall-cmd --zone=public --add-port=8096/ | ||
+ | firewall-cmd --zone=public --add-port=4823/ | ||
+ | firewall-cmd --zone=public --add-port=6001-6200/ | ||
+ | firewall-cmd --zone=public --add-port=6001-6200/ | ||
+ | firewall-cmd --zone=public --add-port=5001-5900/ | ||
+ | firewall-cmd --zone=public --add-port=5001-5900/ | ||
+ | firewall-cmd --zone=public --add-port=861/ | ||
+ | firewall-cmd --zone=public --add-port=8760-9960/ | ||
+ | firewall-cmd --zone=public --add-port=33434-33634/ | ||
+ | |||
+ | This allows the fdt.jar tool to use its default port | ||
+ | firewall-cmd --zone=public --add-port=54321/ | ||
+ | |||
+ | Makes these permanent and reload rule database | ||
+ | firewall-cmd --reload | ||
+ | |||
+ | Lets find the CPU that the 100g NIC is associated with. | ||
+ | cat / | ||
+ | |||
+ | Usual response is either ' | ||
+ | |||
+ | Knowing that, run this command: | ||
+ | lscpu | ||
+ | |||
+ | |||
+ | Most modern CPUs can run at different clock frequencies and often do so to save energy. In our case we want to run the CPU as fast as possible. First lets see what speed each CPU core is running at and what the maximum speed could be. Just run this funky command: | ||
+ | grep -E ' | ||
+ | |||
+ | You'll probably see that the cores aren't running near their spec speed. Most often at a level called ' | ||
+ | |||
+ | This simple command sets all the cores to ' | ||
+ | sudo cpupower frequency-set --governor performance | ||
+ | |||
+ | (No controversy to add/change these values for high speed nics) | ||
+ | # increase TCP max buffer size setable using setsockopt() | ||
+ | # allow testing with 256MB buffers | ||
+ | net.core.rmem_max = 268435456 | ||
+ | net.core.wmem_max = 268435456 | ||
+ | # increase Linux autotuning TCP buffer limits | ||
+ | # min, default, and max number of bytes to use | ||
+ | # allow auto-tuning up to 128MB buffers | ||
+ | net.ipv4.tcp_rmem = 4096 87380 134217728 | ||
+ | net.ipv4.tcp_wmem = 4096 65536 134217728 | ||
+ | # recommended to increase this for CentOS6 with 10G NICS or higher | ||
+ | net.core.netdev_max_backlog = 250000 | ||
+ | # don't cache ssthresh from previous connection | ||
+ | net.ipv4.tcp_no_metrics_save = 1 | ||
+ | # Explicitly set htcp as the congestion control: cubic buggy in older 2.6 kernels | ||
+ | net.ipv4.tcp_congestion_control = htcp | ||
+ | # If you are using Jumbo Frames, also set this | ||
+ | net.ipv4.tcp_mtu_probing = 1 | ||
+ | # recommended for CentOS7/ | ||
+ | net.core.default_qdisc = fq | ||
+ | </ | ||
+ | |||
+ | ==Intel== | ||
+ | < | ||
+ | To configure IRQ affinity, stop irqbalance and then either use the set_irq_affinity script from the | ||
+ | i40e source package or pin queues manually. | ||
+ | Disable user-space IRQ balancer to enable queue pinning: | ||
+ | • systemctl disable irqbalance | ||
+ | • systemctl stop irqbalance | ||
+ | Using the set_irq_affinity script from the i40e source package (recommended): | ||
+ | • To use all cores: | ||
+ | [path-to-i40epackage]/ | ||
+ | • To use only cores on the local NUMA socket: | ||
+ | [path-to-i40epackage]/ | ||
+ | • You can also select a range of cores. Avoid using cpu0 because it runs timer tasks. | ||
+ | [path-to-i40epackage]/ | ||
+ | Manually: | ||
+ | • Find the processors attached to each node using: | ||
+ | numactl --hardware | ||
+ | lscpu | ||
+ | • Find the bit masks for each of the processors: | ||
+ | • Assuming cores 0-11 for node 0: [1, | ||
+ | • Find the IRQs assigned to the port being assigned: | ||
+ | grep ethX / | ||
+ | For example, 181-192 for the 12 vectors loaded. | ||
+ | • Echo the SMP affinity value into the corresponding IRQ entry. Note that this needs to be done for | ||
+ | each IRQ entry: | ||
+ | echo 1 > / | ||
+ | echo 2 > / | ||
+ | echo 4 > / | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==ethtool== | ||
+ | from vm host | ||
+ | < | ||
+ | [root@fiona ~]# ethtool -k ens4np0 | ||
+ | Features for ens4np0: | ||
+ | rx-checksumming: | ||
+ | tx-checksumming: | ||
+ | tx-checksum-ipv4: | ||
+ | tx-checksum-ip-generic: | ||
+ | tx-checksum-ipv6: | ||
+ | tx-checksum-fcoe-crc: | ||
+ | tx-checksum-sctp: | ||
+ | scatter-gather: | ||
+ | tx-scatter-gather: | ||
+ | tx-scatter-gather-fraglist: | ||
+ | tcp-segmentation-offload: | ||
+ | tx-tcp-segmentation: | ||
+ | tx-tcp-ecn-segmentation: | ||
+ | tx-tcp-mangleid-segmentation: | ||
+ | tx-tcp6-segmentation: | ||
+ | generic-segmentation-offload: | ||
+ | generic-receive-offload: | ||
+ | large-receive-offload: | ||
+ | rx-vlan-offload: | ||
+ | tx-vlan-offload: | ||
+ | ntuple-filters: | ||
+ | receive-hashing: | ||
+ | highdma: on [fixed] | ||
+ | rx-vlan-filter: | ||
+ | vlan-challenged: | ||
+ | tx-lockless: | ||
+ | netns-local: | ||
+ | tx-gso-robust: | ||
+ | tx-fcoe-segmentation: | ||
+ | tx-gre-segmentation: | ||
+ | tx-gre-csum-segmentation: | ||
+ | tx-ipxip4-segmentation: | ||
+ | tx-ipxip6-segmentation: | ||
+ | tx-udp_tnl-segmentation: | ||
+ | tx-udp_tnl-csum-segmentation: | ||
+ | tx-gso-partial: | ||
+ | tx-tunnel-remcsum-segmentation: | ||
+ | tx-sctp-segmentation: | ||
+ | tx-esp-segmentation: | ||
+ | tx-udp-segmentation: | ||
+ | tx-gso-list: | ||
+ | rx-udp-gro-forwarding: | ||
+ | rx-gro-list: | ||
+ | tls-hw-rx-offload: | ||
+ | fcoe-mtu: off [fixed] | ||
+ | tx-nocache-copy: | ||
+ | loopback: off [fixed] | ||
+ | rx-fcs: off | ||
+ | rx-all: off | ||
+ | tx-vlan-stag-hw-insert: | ||
+ | rx-vlan-stag-hw-parse: | ||
+ | rx-vlan-stag-filter: | ||
+ | l2-fwd-offload: | ||
+ | hw-tc-offload: | ||
+ | esp-hw-offload: | ||
+ | esp-tx-csum-hw-offload: | ||
+ | rx-udp_tunnel-port-offload: | ||
+ | tls-hw-tx-offload: | ||
+ | rx-gro-hw: off [fixed] | ||
+ | tls-hw-record: | ||
+ | </ |