Package: netutils-linux
netutils-linuxIt’s a useful utils to simplify Linux network troubleshooting and performance tuning, developed in order to helpCarbon Reductortechsupport and automate the whole linux performance tuning process out of box (ok, except the best RSS layout detection with multiple network devices). These utils may be useful for datacenters and internet service providers with heavy network workload (you probably wouldn’t see an effect at your desktop computer). It’s now in production usage with 300+ deployment and save us a lot of time with hardware and software settings debugging. Inspired bypackagecloud’s blog post.InstallationYou’ll needpip.pipinstallnetutils-linuxUsageCheck thisguideabout usage.UtilsMonitoringAll these top-like utils don’t require root priveledges or sudo usage. So you can install and use them as non-priveledged user if you care about security.pipinstall--usernetutils-linuxBrief explanation about highlighting colors for CPU and device groups: green and red are for NUMA-nodes, blue and yellow for CPU sockets. Screenshots are taken from different hosts with different hardware.network-topMost useful util in this repo that includes almost all linux network stack performance metrics and allow to monitor interrupts, soft interrupts, network processing statistic for devices and CPUs. Based on following files:/proc/interrupts(vectors with small amount of irqs/second are hidden by default)/proc/net/softnet_stat- packet distribution and errors/squeeze rate between CPUs./proc/softirqs(only NET_RX and NET_TX values)./sys/class/net/<NET_DEVICE>/statistic/<METRIC>files (you can specify units, mbits are default)There are also separate utils if you want to look at only specific metrics: irqtop, softirq-top, softnet-stat-top, link-rate.snmptopBasic /proc/net/smmp file watcher.Tuningrss-ladderAutomatically setsmp_affinity_listfor IRQ of NIC rx/tx queues that usually work on CPU0 out of the box).Based on lscpu’s output.It also supports double/quad ladder in case of multiprocessor systems (but you better explicitly specify queue count == core per socket as NIC’s driver’s param). Example output:# rss-ladder eth1 0
- distributing interrupts of eth1 (-TxRx-) on socket 0
  - eth1: irq 67 eth1-TxRx-0 -> 0
  - eth1: irq 68 eth1-TxRx-1 -> 1
  - eth1: irq 69 eth1-TxRx-2 -> 2
  - eth1: irq 70 eth1-TxRx-3 -> 3
  - eth1: irq 71 eth1-TxRx-4 -> 8
  - eth1: irq 72 eth1-TxRx-5 -> 9
  - eth1: irq 73 eth1-TxRx-6 -> 10
  - eth1: irq 74 eth1-TxRx-7 -> 11autorpsEnables RPS on all available CPUs of NUMA node local for the NIC for all NIC’s rx queues. It may be good for small servers with cheap network cards. You also can explicitely pass--cpusor--cpu-mask. Example output:# autorps eth0
Using mask 'fc0' for eth0-rx-0.maximize-cpu-freqSets every CPU scaling governor mode to performance and set max scaling value for min scaling value. So you will be able to use all power of your processor (useful for latency sensible systems).rx-buffers-increaserx-buffers-increase utils, that finds and sets compromise-value between avoiding dropped/missing pkts and keeping a latency low.Example output:# ethtool -g eth1

Ring parameters for eth1:
Pre-set maximums:
RX:           4096
...
Current hardware settings:
RX:           256

# rx-buffers-increase eth1

run: ethtool -G eth1 rx 2048

# rx-buffers-increase eth1

eth1's rx ring buffer already has fine size.

# ethtool -g eth1

Ring parameters for eth1:
Pre-set maximums:
RX:           4096
...
Current hardware settings:
RX:           2048Hardware and its configuration rating. server-infoMuch alike lshw but designed for network processing role of server.Information about server➜  vscale-vm git:(folding) ✗ server-info --showcpu:info:Architecture:x86_64BogoMIPS:4399Byte Order:Little EndianCPU MHz:2199CPU family:6CPU op-mode(s):32-bit, 64-bitCPU(s):1Core(s) per socket:1Flags:fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmonrep_good nopl eagerfpu pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apicmovbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lmabm 3dnowprefetch tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjustbmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt aratHypervisor vendor:KVML1d cache:32KL1i cache:32KL2 cache:256KL3 cache:25600KModel:79Model name:Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHzNUMA node(s):1NUMA node0 CPU(s):0On-line CPU(s) list:0Socket(s):1Stepping:1Thread(s) per core:1Vendor ID:GenuineIntelVirtualization:VT-xVirtualization type:fulllayout:'0':'0'disk:vda:model:nullsize:21474836480type:HDDmemory:devices:'0x1100':size:'512'speed:0type:RAMsize:MemFree:78272MemTotal:500196SwapFree:0SwapTotal:0net:eth0:buffers:cur:256max:256conf:ip:''vlan:falsedriver:driver:virtio_netversion:1.0.0queues:own:[]rx:[]rxtx:[]shared:[]tx:[]unknown:[]Overall server rating➜  vscale-vm git:(folding) ✗ server-info --rate --serverserver:1.7666666666666664Subsystems rating➜  vscale-vm git:(folding) ✗ server-info --rate --subsystemcpu:4.5disk:1.0memory:1.0net:1.3333333333333333system:1.0Devices rating➜  vscale-vm git:(folding) ✗ server-info --rate --devicecpu:BogoMIPS:2CPU MHz:2CPU(s):1Core(s) per socket:1L3 cache:9Socket(s):1Thread(s) per core:10Vendor ID:10disk:vda:1.0memory:devices:'0x1100':1.0size:1.0net:eth0:1.3333333333333333system:Hypervisor vendor:1Virtualization type:1Device’s detailed rating➜  vscale-vm git:(folding) ✗ server-info --ratecpu:BogoMIPS:2CPU MHz:2CPU(s):1Core(s) per socket:1L3 cache:9Socket(s):1Thread(s) per core:10Vendor ID:10disk:vda:size:1type:1memory:devices:'0x1100':size:1speed:1type:1size:MemTotal:1SwapTotal:1net:eth0:buffers:cur:1max:1driver:2queues:1system:Hypervisor vendor:1Virtualization type:1How to contribute?Close issuesAny help is welcome. Just comment an issue with “I want to help, how can I solve this issue?” to start.or donatehttps://patreon.com/strizhechenkohttps://rocketbank.ru/oleg.strizhechenkohttps://paypal.me/weirded