Tuning the Linux Kernel with AI, According to ByteDance (Translation)

Linux is good for most tasks, but to do it even better requires tuning the kernel, and this is never easy. ByteDance has a proposal to make this easier.

Richmond, Virginia: At the “Linux Plumbers Conference,” an invitation-only gathering of leading Linux kernel developers, ByteDance Linux kernel engineer Kong Wang proposed using artificial intelligence (AI) and machine learning (ML) to tune the Linux kernel for maximum results under specific workloads.

Overall, the Linux kernel does a great job of handling most tasks. But to get the most out of it for specific tasks, you need to configure it by setting certain parameters to achieve the best results. But there is one small problem – There are thousands of parameters. Because of which, even for a Linux kernel expert, tuning them for optimal performance is a long and hard job. And of course, different workloads require different settings in the Linux kernel parameter set. Thus, as Wang said, “In large data centers like ByteDance, it has become virtually impossible to manually tune Linux kernel parameters for hundreds of different workloads.”

Tools such as System Management Interface Tool (SMIT), Sysctl, and TuneD can help. But they just make it easier for you to make manual kernel configuration changes. There are also smart programs, such as Red Hat’s BayOp, that use machine learning specifically to optimize the performance of network applications, but this is not a general purpose AI/ML program; it is designed for a specific Linux setup.

ByteDance is working on the first attempt to automate the entire process of configuring Linux kernel parameters with minimal engineering effort. In particular, ByteDance is working on tuning memory management in the kernel. ByteDance found that using machine learning algorithms such as Bayesian optimization, automated tuning can outperform even most Linux kernel engineers.

Why? Well, the idea, as Wang wryly puts it, “is not to put Linux kernel engineers out of work.” No, the goal is “to free human engineers from having to tune performance for each individual workload. In doing so, make more informed decisions based on historical data that people often encounter. And last but not least, find better solutions than the ones we come up with using our current trial and error, heuristic methods.

How? The autotuning system is designed to automatically tune the internal parameters of the Linux kernel depending on the specific workload and hardware configuration. This dynamic tuning ensures optimal performance, solving a long-standing problem in the Linux community of manually tuning the kernel for specific scenarios. To achieve this, the AI/ML platform uses several algorithms such as Bayesian optimization, genetic algorithm and simulated annealing algorithm (evolutionary algorithm).

Result?

  • Dynamic optimization: The system constantly monitors core performance, making real-time adjustments to settings such as processor frequency scaling and memory management.

  • Increased efficiency. By optimizing resource utilization, autotuning significantly improves the efficiency of Linux kernel-based systems, especially in environments with varied workloads.

  • User-Friendly Interface: The system includes a user-friendly interface that allows even those with limited technical knowledge to take advantage of increased kernel performance.

  • Customizable Settings: Advanced users can customize Auto-Tuning settings, tailoring the system to their specific needs.

It’s still early days, but ByteDance has already seen some success. For example, by using DAMON, a subsystem of the Linux kernel for monitoring and optimizing memory access, they were able to find the best design for a MySQL application. This was done by running different DAMON schemes and comparing their performance. They found that they could reduce an application’s memory usage by 30%. For mass applications, this is a real saving.

In another case, ByteDance was able to optimize HTTP network latency on an NGINX server by optimizing the configuration of 16 kernel sysctl parameters. In the best case, ML tuning improved NGNIX network performance by 12% compared to expert manual tuning. Again, this is a significant improvement.

ByteDance doesn’t claim that its AI/ML approach will be suitable for every Linux customization task, but Wang said, “While there are limitations, we believe that kernel machine learning is not only possible, but necessary.”

What I think ? I think this is a potential game changer for Linux applications. By making kernel optimization easier, Linux will become more accessible and efficient for a wider range of users and applications. In particular, I see autotuning improving the performance of almost all servers, cloud computing, and data center applications.

Additional materials :

Danon – (link – Danon )

Artificial Intelligence (AI) and Machine Learning (ML) to Customize the Linux Kernel(PDF) – ( link )

System Management Interface (SMIT)-( link )

Sysctl – ( link )

Tuned -( link )

BayOp – ( link )

Bayesian optimization- ( link )

Simulated Annealing Algorithm (Evolutionary Algorithm) (PDF) – ( link )

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *