How do I improve the real-time performance of Linux for industrial automation?

Industrial automation systems rely heavily on real-time performance to ensure smooth and accurate operation of equipment and machinery. However, achieving reliable real-time performance on Linux is quite challenging. In this blog post, we will explore some strategies for improving real-time performance in Linux systems used in industrial automation.

Leverage the Benefits of Your Real-Time Kernel

The most obvious and most effective way to improve real-time performance under Linux is to run a real-time capable kernel. One of the most common ones is the PREEMPT_RT Patch, which adds real-time capabilities to a standard Linux kernel. Assigning real-time priority to critical tasks by means of the “chrt” command ensures these are scheduled before other, uncritical tasks and are less likely to be preempted

Distribute Your Workload

But not only a task’s priority, also its CPU affinity may deeply impact its real-time performance. Tools such as “taskset” allow assigning workload to a specific CPU core, while core isolation ensures no other tasks will run on this specific core. On top, tweaks to the Completely Fair Scheduler (CFS), Linux’s default task scheduler, may lead to significant improvements for tasks running on CPU cores with mixed workload.

Know Your Hardware Features

Hardware features such as dynamic overclocking, enhanced power states and Simultaneous Multithreading (SMT) are great ways to dynamically adjust your hardware to changing workloads. However, they can be a huge drawback for applications with deterministically recurring workloads. Putting your CPU to sleep right before the next compute cycle adds delays due to migrating workload between cores or hardware wake-ups. In industrial scenarios, it is often wise to disable these features for more consistent response times.

In conclusion, achieving reliable real-time performance in Linux systems used in industrial automation requires a combination of strategies on both the hardware and the software level. With your hardware ready to handle real-time workloads, you have plenty of ways to tweak the software side and have your real-time workload handled optimally.

How to get help

Real-time on your Linux system is a topic for you, but you have no experience or resources in your team to implement it?
No problem, we at FLECS are happy to advise you or take over the complete customization and optimization of your Linux based automation system.
Contact us if you would like to learn more. We will be happy to check the possibilities for real-time optimization on your platform without obligation.

Contact us