Linux : How to tune up receive (TX) and transmit (RX) buffers on network interface

By | May 5, 2015

Modern and performance/server grade network interface have the capability of using transmit and receive buffer description ring into the main memory. They use direct memory access (DMA) to transfer packets from the main memory to carry packets independently from the CPU.

The usual default buffering values for regular desktop NICs are 256 or 512 bytes. High performances NICs can achieve up to 4096 and/or 8192 bytes.

To view the capability and the current values of your interface, you’ll need “ethtool”. Simply do the following command :

ethtool -g eth0

This will output something like this :

Ring parameters for eth0:
Pre-set maximums:
RX:		4096
RX Mini:	2048
RX Jumbo:	4096
TX:		4096
Current hardware settings:
RX:		1024
RX Mini:	128
RX Jumbo:	256
TX:		512

We can see here that both RX and TX values are set to lower values than the interface support.

To increase the buffers, do the following :

ethtool -G eth0 rx 4096 tx 4096
ethtool -G eth0 rx-mini 2048 rx-jumbo 4096