Performance progression of IPv4 route lookup on Linux
TL;DR: Each of Linux 2.6.39, 3.6 and 4.0 brings notable performance improvements for the IPv4 route lookup process.
In a previous article, I explained how Linux implements an IPv4 routing table with compressed tries to offer excellent lookup times. The following graph shows the performance progression of Linux through history:
Two scenarios are tested:
- 500,000 routes extracted from an Internet router (half of them are /24), and
- 500,000 host routes (/32) tightly packed in 4 distinct subnets.
All kernels are compiled with GCC 4.9 (from Debian Jessie). This
version is able to compile older kernels1 as well as current
ones. The kernel configuration used is the default one with
CONFIG_SMP
and CONFIG_IP_MULTIPLE_TABLES
options enabled (however,
no IP rules are used). Some other unrelated options are enabled to be
able to boot them in a virtual machine and run the benchmark.
The measurements are done in a virtual machine with one
vCPU2. The host is an Intel Core i5-4670K and the CPU
governor was set to “performance”. The benchmark is
single-threaded. Implemented as a kernel module, it calls
fib_lookup()
with various destinations in 100,000 timed iterations
and keeps the Continue reading