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