About increasing of network performance in linux.

Usually the network settings are optimized for working with the usual type of traffic, which in most cases represents the transfer of large packages by activating of the data channel.

But the same channel can be loaded in small packets, but we have to send and receive them much ofter. A very important parameter for network card (driver) are NIC Ring Buffers - the number of buffers for transmission and reception.

The default settings can be viewed using the utility ethtool:

# ethtool -g eth0
Ring parameters for eth0:
Pre-set maximums:
RX:             4096
RX Mini:        0
RX Jumbo:       0
TX:             4096
Current hardware settings:
RX:             128
RX Mini:        0
RX Jumbo:       0
TX:             256

Here we can see two sections. The section on the top presents the maximum values that can be specified by relevant parameters. The section below presents the current settings.

When the traffic is generated in small packages we need to increase the size of the buffers rx и tx:

# ethtool -G eth0 rx 4096
# ethtool -G eth0 tx 4096

# ethtool -g eth0
Ring parameters for eth0:
Pre-set maximums:
RX:             4096
RX Mini:        0
RX Jumbo:       0
TX:             4096
Current hardware settings:
RX:             4096
RX Mini:        0
RX Jumbo:       0
TX:             4096