0% found this document useful (0 votes)
46 views1 page

Configure Postgres Performance Huge Pages

The document shows commands to configure and view hugepages on a Linux system. It pipes the output of awk command parsing /proc/meminfo into sort and grep to display hugepage sizes and usage. It then echoes a configuration to /etc/sysctl.d/42-hugepages.conf to set the number of hugepages to 2048, with each page being 2 MB in size for a total of 4 GB of hugepages. Finally, it runs sysctl --system to apply the configuration.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views1 page

Configure Postgres Performance Huge Pages

The document shows commands to configure and view hugepages on a Linux system. It pipes the output of awk command parsing /proc/meminfo into sort and grep to display hugepage sizes and usage. It then echoes a configuration to /etc/sysctl.d/42-hugepages.conf to set the number of hugepages to 2048, with each page being 2 MB in size for a total of 4 GB of hugepages. Finally, it runs sysctl --system to apply the configuration.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

awk '/Hugepagesize:/{p=$2} / 0 /{next} / kB$/{v[sprintf("%9d MB %-s",int($2/1024),

$0)]=$2;next} {h[$0]=$2} /HugePages_Total/{hpt=$2} /HugePages_Free/{hpf=$2}


{h["HugePages Used (Total-Free)"]=hpt-hpf} END{for(k in v) print sprintf("%-60s
%10d",k,v[k]/p); for (k in h) print sprintf("%9d MB %-s",p*h[k]/1024,k)}'
/proc/meminfo|sort -nr|grep --color=auto -iE "^|( HugePage)[^:]*"

# Use 2048 MB for hube pages , each page have 2mb


echo 'vm.nr_hugepages = 2048' > /etc/sysctl.d/42-hugepages.conf

sysctl --system

You might also like