Simple Patch Lets Amazon's EC2 Linux Network Driver Start ~90x Faster
With how ubiquitous the Amazon Elastic Compute Cloud (EC2) is, one may have assumed that for years the software stack was already extensively optimized to insane levels, especially as it concerns the boot time for being able to quickly respond to changes in load... But it turns out there still is some low hanging fruit such as with Amazon's "ENA" network driver and a new patch allowing it to initialize 90 times quicker.
The ENA Linux kernel driver is for the "Elastic Network Adapter" that provides the enhanced networking capabilities for Linux running on Amazon EC2. Interestingly, Intel engineer Josh Triplett managed to discover a big optimization out of the ENA driver with a rather trivial patch.
The ENA driver polls for responses on the admin command queue and currently waits five milliseconds between polls, but the hardware generally finishes much quicker. So in turn the Intel open-source developer changed the polling time from five milliseconds to 10 microseconds.
With the much shorter time between polling, the ENA driver initialization time dropped from 173 milliseconds to a mere 1.9 milliseconds, or as Josh noted, an improvement of more than 90x. This allows the EC2 instances to boot quicker and bringing up the network ever so slightly faster.
The patch is now pending review. If accepted this Amazon ENA network driver improvement could be mainlined as soon as Linux 5.7 or also picked up by Amazon Linux and other EC2-optimized distributions/kernels sooner.
The ENA Linux kernel driver is for the "Elastic Network Adapter" that provides the enhanced networking capabilities for Linux running on Amazon EC2. Interestingly, Intel engineer Josh Triplett managed to discover a big optimization out of the ENA driver with a rather trivial patch.
The ENA driver polls for responses on the admin command queue and currently waits five milliseconds between polls, but the hardware generally finishes much quicker. So in turn the Intel open-source developer changed the polling time from five milliseconds to 10 microseconds.
With the much shorter time between polling, the ENA driver initialization time dropped from 173 milliseconds to a mere 1.9 milliseconds, or as Josh noted, an improvement of more than 90x. This allows the EC2 instances to boot quicker and bringing up the network ever so slightly faster.
The patch is now pending review. If accepted this Amazon ENA network driver improvement could be mainlined as soon as Linux 5.7 or also picked up by Amazon Linux and other EC2-optimized distributions/kernels sooner.
14 Comments