MySQL for larger page, lock memory Memlock, do not use swap space

Source: Internet
Author: User
Tags dba mysql in

Hugepage Introduction

Hugepage technology is an added feature of Linux in Kernel 2.6, the basic principle is: use a larger page to achieve greater memory access!

This technology can be supported in Linux kernel 2.6 and above, 32-bit and 64-bit! The size of the
Fan Wei is 2MB to 256MB, depending on the kernel version and the server hardware architecture!
Hugepage Benefits:

1. Increase the hit ratio of the TLB;
3. Lock memory to reduce the performance degradation caused by memory release and consumption;
4. Improve memory performance and reduce CPU load.

Note: Hugepages is supported only by InnoDB in MySQL
MySQL in hugepages settings
correct settings, Shmmax, Shmall and other parameters
1. Set Max locked Memory
#vi/etc/security/limits.conf
MySQL hard Memlock unlimited
MySQL soft Memlock unlimited
2. Add the MySQL user-owned group to the system kernel
# ID MySQL
uid=501 (MySQL) gid=501 (dba) groups=501 (DBA)
#echo 501 >/proc/sys/vm/hugetlb_shm_group
3. Configure MY.CNF
[Mysqld]
large-pages
[Mysqld]
large-pages
4. Start Mysqld


MySQL for larger page, lock memory Memlock, do not use swap space

Related Article

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.