MySQL database InnoDB an important kernel parameter of the engine swappiness

Source: Internet
Author: User

There is a parameter called swappiness in the Linux kernel. You can adjust how memory is used.

By default, this value is 60, which means that the kernel will provide more memory for the file system as a cache, or even swap the memory occupied by some programs into swap to free up memory.

This is just a conflict with the MySQL database using the InnoDB engine: The InnoDB buffer pool is inherently equivalent to the file system cache, which caches a portion of the database that has been read.

This part of memory usually does not modify the changes, so the operating system will be more inclined to swap out this part of memory into swap. This way, when MySQL really needs to innodb in the buffer

Data, the operating system needs to re-read the corresponding swap into memory, or even worse, it will swap other portions of memory to swap to maintain sufficient system memory (file system cache).

This makes the INNODB buffer not only accelerates, but is slower than not caching.

For this scenario, consider setting the swappiness parameter to 0: try to allocate memory to the program process (this is exactly the InnoDB buffer) rather than the file system cache.

The specific commands are as follows:

echo 0 > /proc/sys/vm/swappiness


An important kernel parameter for the MySQL database InnoDB engine 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.