Threats from the killer kernel configuration change –swappiness

Source: Internet
Author: User

We are subject to non-hacker attacks, which are Linux kernel version 3.5-rc1 and redhat backport patch response swappiness=0. This is a real threat, and one of our clients is affected by the use of the oom mechanism to crash the MySQL primary database server. This "tiny" change to the kernel causes the system not to swap properly, causing the oom mechanism to kill the MySQL process directly. This explains the following explanation: The system already has 128GB of memory, a lot of memory is idle, and has 128GB of free virtual memory, so in no case should start the oom mechanism.


We thought the reason was Numa (previously written about Numa), but if so, we would see some excessive swapping as a result of Intra-node. We configured Mysql-safe to use NUMA interactive mode by installing NUMCTL, but eventually it crashed.


Originally, the server had a new kernel, Rhel/centos 6.4, 2.6.32-358, released in February 2013. This version of the kernel and future versions have backport patches, the system can be upgraded to 6.4 and higher, and we look forward to a lot of problems in this critical area.


This is frustrating because Redhat is not supposed to change some behavior in backport or like RHEL6 in a life cycle, their purpose is clear, things like this will not happen, such as in the system 5-10 years of life behavior is consistent. So when a major problem like this occurs in a product life cycle, it can be bad, such as forced upgrades, configuration changes, default installation upgrades, monitoring, and audit changes. Most of the latest Debian/ubuntu systems will also have these problems because they also have newer kernels, perhaps the same backport.


About Swappiness is often misunderstood by engineers. It can be set to a value from 0-100 to inform the kernel which is more important, whether it is Pagecache (file cache) or application memory. The default value is 60, which means that pagecache memory can be used more often, but this is a very bad configuration for the server. From a virtualization perspective, all servers require application memory, more than file cache, so we have been set to 0, indicating that the file cache will be released until any application memory is swap. But now, this bug leads to less swapping, which greatly increases the chances of the OOM mechanism working under memory pressure, which is really not what we want. What are the technical solutions that can be solved quickly? Fortunately, we have a very simple plan. Set Swappiness to 1, which is almost the same priority as 0 to protect application memory, but does not trigger kernel changes. So, 1:0 is a better configuration.


As always, we monitor and manage these types of issues for our customers, continually upgrade the default installation configuration, and cycle through upgrades to affect the system.


Threats from the killer kernel configuration change –swappiness

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.