Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the relevant settings of Huge Pages in Linux

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the relevant knowledge of "What are the relevant settings of Huge Pages in Linux". In the actual case operation process, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!

PostgreSQL uses the parameter huge_pages to set whether large pages are enabled, using resident memory to improve performance

Check if CPU supports HugePages 2MB Size

The command is as follows, the keyword is pse(Page Size Extension)

[root@localhost ~]# cat /proc/cpuinfo | grep pse | uniqflags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm fsgsbase smep arat[root@localhost ~]# [root@localhost ~]#cat /proc/cpuinfo | egrep -o pse | head -n 1pse[root@localhost ~]#

Check if CPU supports HugePages 1GB Size

The command is as follows, the keyword is pdpe1gb

[root@localhost ~]# grep pdpe1gb /proc/cpuinfo | head -n 1flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm fsgsbase smep arat[root@localhost ~]# [root@localhost ~]# egrep -o pdpe1gb /proc/cpuinfo | head -n 1pdpe1gb[root@localhost ~]#

How to change default HugePage size?

Default size is 2MB

[root@localhost ~]# grep Hugepagesize: /proc/meminfoHugepagesize: 2048 kB[root@localhost ~]#

Change command to

[root@localhost ~]# grep GRUB_CMDLINE_LINUX /etc/sysconfig/grubGRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet"[root@localhost ~]# [root@localhost ~]# vim /etc/sysconfig/grub[root@localhost ~]# grep GRUB_CMDLINE_LINUX /etc/sysconfig/grubGRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet default_hugepagesz=1G"[root@localhost ~]# [root@localhost ~]# grub2-mkconfig -o /boot/grub2/grub.cfgGenerating grub configuration file ... Found linux image: /boot/vmlinuz-5.2.14-1.el7.elrepo.x86_64Found initrd image: /boot/initramfs-5.2.14-1.el7.elrepo.x86_64.imgFound linux image: /boot/vmlinuz-3.10.0-957.27.2.el7.x86_64Found initrd image: /boot/initramfs-3.10.0-957.27.2.el7.x86_64.imgFound linux image: /boot/vmlinuz-3.10.0-693.el7.x86_64Found initrd image: /boot/initramfs-3.10.0-693.el7.x86_64.imgFound linux image: /boot/vmlinuz-0-rescue-f0b4bffdc9e44816abd201320f8a4f75Found initrd image: /boot/initramfs-0-rescue-f0b4bffdc9e44816abd201320f8a4f75.imgdone[root@localhost ~]# [root@localhost ~]# rebootConnection closed by foreign host. [root@localhost ~]# grep Hugepagesize /proc/meminfoHugepagesize: 1048576 kB[root@localhost ~]#"What are the relevant settings of Huge Pages in Linux" is introduced here. Thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report