NIC tuning (ethtool) Optimize a network card on a HolyCloud dedicated server with ethtool: ring buffers, offloads, IRQ, and link diagnostics. ~12 min read Advanced #ethtool #network #nic #performance NIC tuning (ethtool) On a dedicated server with heavy traffic (CDN, streaming, VPN terminator), default NIC settings may limit throughput or increase latency. ethtool inspects and changes link and hardware offload settings. Prerequisites Linux dedicated server, identified interface (ip link) root access Backup current settings before changes Understanding: some offloads break bridging/VPN if misconfigured Identification ip -br link ethtool eth0 ethtool -i eth0 Note: driver, firmware, Speed, Duplex, Link detected. Link diagnostics ethtool eth0 | grep -E 'Speed|Duplex|Auto|Link' ethtool -S eth0 | less Error counters: ethtool -S eth0 | grep -iE 'err|drop|fifo' CRC errors → cable, SFP, switch port. Discuss with HolyCloud if hardware is leased. Ring buffers (rx/tx) Increasing rings reduces drops under bursts: ethtool -g eth0 ethtool -G eth0 rx 4096 tx 4096 Max values per card: ethtool -g eth0 | head Persist via systemd or @reboot script — ethtool does not always persist alone. Example unit /etc/systemd/system/nic-tune.service: [Unit] Description=NIC ethtool tuning After=network.target [Service] Type=oneshot ExecStart=/usr/sbin/ethtool -G eth0 rx 4096 tx 4096 RemainAfterExit=yes [Install] WantedBy=multi-user.target sudo systemctl enable --now nic-tune.service Offloads: enable or disable? List: ethtool -k eth0 | Offload | Role | Disable if… | |---------|------|----------------| | tcp-segmentation-offload (TSO) | Outbound TCP segmentation | Fine capture, some tunnels | | generic-receive-offload (GRO) | Receive aggregation | Specific Open vSwitch bridge | | lro | Large Receive Offload | Rare asymmetric routing | Classic 10 GbE web server: # often leave offloads ON ethtool -K eth0 tso on gso on gro on VPN bridge / transparent bridge: ethtool -K eth0 gro off lro off Interrupt coalescing Reduces IRQ under load: ethtool -c eth0 sudo ethtool -C eth0 rx-usecs 50 tx-usecs 50 Too aggressive → higher latency; measure with mpstat and softnet_stat. IRQ and RPS/XPS IRQ affinity (multi-queue): grep eth0 /proc/interrupts # set_irq_affinity scripts per Intel/Mellanox vendor RPS (Receive Packet Steering) if a single queue saturates: echo 4096 | sudo tee /proc/sys/net/core/rps_sock_flow_entries Kernel documentation: spread load across CPUs. Flow control (pause frames) ethtool -a eth0 In datacenters, often off on both sides to avoid cascade pauses — validate with the operator. sudo ethtool -A eth0 rx off tx off Throughput test iperf3 -s # external client iperf3 -c IP_PUBLIQUE -P 8 -t 30 Compare before/after tuning; watch ethtool -S drops. Multi-gigabit NIC (e.g. Intel X710) Load correct firmware, use intel-i40e / mlx5 repos per card. HolyCloud lists the chipset on the server sheet. dmesg | grep -i eth0 lspci | grep -i ethernet Rollback sudo ethtool -G eth0 rx 512 tx 512 sudo ethtool -K eth0 gro on gso on tso on Reboot if the driver stays unstable. Troubleshooting | Symptom | Hint | |----------|-------| | Link flapping | SFP cable, auto-negotiation, ethtool -r eth0 reset | | Throughput capped at 100M | Negotiation, cat5 cable | | Loss after ethtool -G | Value too high — revert to allowed max | Need help? Provide ethtool eth0, ethtool -S eth0, card model (lspci -v), and traffic type for HolyCloud switch port advice. Continue reading Previous article Network bonding (LACP) Read Next article Reinstall the dedicated server Read