
Red Hat Enterprise Linux Network Performance Tuning
Guide
Authors: Jamie Bainbridge and Jon Maxwell
Reviewer: Noah Davids
Editors: Dayle Parker and Chris Negus
03/25/2015
Tuning a network interface card (NIC) for optimum throughput and latency is a complex process
with many factors to consider.
These factors include capabilities of the network interface, driver features and options, the system
hardware that Red Hat Enterprise Linux is installed on, CPU-to-memory architecture, amount of
CPU cores, the version of the Red Hat Enterprise Linux kernel which implies the driver version,
not to mention the workload the network interface has to handle, and which factors (speed or
latency) are most important to that workload.
There is no generic configuration that can be broadly applied to every system, as the above
factors are always different.
The aim of this document is not to provide specific tuning information, but to introduce the reader
to the process of packet reception within the Linux kernel, then to demonstrate available tuning
methods which can be applied to a given system.
PACKET RECEPTION IN THE LINUX KERNEL
The NIC ring buffer
Receive ring buffers are shared between the device driver and NIC. The card assigns a transmit
(TX) and receive (RX) ring buffer. As the name implies, the ring buffer is a circular buffer where an
overflow simply overwrites existing data. It should be noted that there are two ways to move data
from the NIC to the kernel, hardware interrupts and software interrupts, also called SoftIRQs.
The RX ring buffer is used to store incoming packets until they can be processed by the device
driver. The device driver drains the RX ring, typically via SoftIRQs, which puts the incoming
packets into a kernel data structure called an sk_buff or “skb” to begin its journey through the
kernel and up to the application which owns the relevant socket. The TX ring buffer is used to
hold outgoing packets which are destined for the wire.
These ring buffers reside at the bottom of the stack and are a crucial point at which packet drop
can occur, which in turn will adversely affect network performance.
Interrupts and Interrupt Handlers
Interrupts from the hardware are known as “top-half” interrupts. When a NIC receives incoming
data, it copies the data into kernel buffers using DMA. The NIC notifies the kernel of this data by
Red Hat Enterprise Linux Network Performance Tuning Guide | Bainbridge, Maxwell 1
评论