pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mladen Gogala <gogala.mladen@gmail.com>
To: Kenny Bachman <kenny.bachman17@gmail.com>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: Postgresql 14 performance
Date: Mon, 22 Aug 2022 20:06:12 -0400
Message-ID: <df274234-9553-c09c-52ed-79127716ec99@gmail.com> (raw)
In-Reply-To: <CAC0w7L+GFza2xyAt-4SQwsMbQWAUqCf7tp+k5gOQZ6hwknDh3w@mail.gmail.com>
References: <CAC0w7LL+uFgPvctiHMxrVZV-DnNVg2K_wFaeZwM96XQFkjk1uA@mail.gmail.com>
	<CAMkU=1yomYgYxMx8nwXUAv1+iM5aJTuqW+Qo3Qz6nGaFbGwSFA@mail.gmail.com>
	<CAC0w7LLghXX+kmkqWAP0-UyanqNCVaWkbtbrZ7yqzX4CoM6i0A@mail.gmail.com>
	<CAMkU=1y30sj8rWcgDoJb4PF0Xb4_N_nv8dppd-xZO3d1CGVZqQ@mail.gmail.com>
	<d8df81e2-c844-d7f5-f1e6-7c050ecaa4c2@gmail.com>
	<bec3b0ff-a0b9-f5d0-4ee7-8af167d04a51@gmail.com>
	<CAC0w7L+GFza2xyAt-4SQwsMbQWAUqCf7tp+k5gOQZ6hwknDh3w@mail.gmail.com>

On 8/22/22 09:17, Kenny Bachman wrote:
> The huge_pages parameter is try. How can I know the huge page is used 
> for shared buffers?
> Also, I would like to say one more thing. Some queries have high 
> planning time of explain analyze output. However, I run vacuumdb 
> analyze command every day. I am a little bit confused about this.
>
> Warm regards,
> Kenn


Hi Kenny,

You can check by using grep -i huge /proc/meminfo. If your shared 
buffers are properly allocated, you will see something like this:

grep -i huge /proc/meminfo Anon*Huge*Pages: 0 kB Shmem*Huge*Pages: 0 kB 
File*Huge*Pages: 0 kB *Huge*Pages_Total: 3072 *HugePages_Free: 6* 
*Huge*Pages_Rsvd: 3 *Huge*Pages_Surp: 0 *Huge*pagesize: 2048 kB 
*Huge*tlb: 6291456 kB

If, on the other side, huge pages are not allocated properly, you will get something like this:

grep -i huge /proc/meminfo Anon*Huge*Pages: 0 kB Shmem*Huge*Pages: 0 kB 
File*Huge*Pages: 0 kB *Huge*Pages_Total: 0 *Huge*Pages_Free: 0 
*Huge*Pages_Rsvd: 0 *Huge*Pages_Surp: 0 *Huge*pagesize: 2048 kB 
*Huge*tlb: 0 kB

HugePages total and free will be equal. You need to put the right number into /etc/sysctl.conf:

grep vm.nr_hugepages /etc/sysctl.conf *vm.nr_hugepages*=3072

Regards


-- 
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com

view thread (20+ messages)  latest in thread

Message-ID: <df274234-9553-c09c-52ed-79127716ec99@gmail.com>
Permalink:  ../df274234-9553-c09c-52ed-79127716ec99@gmail.com/
Also on:    postgresql.org/message-id/df274234-9553-c09c-52ed-79127716ec99@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: gogala.mladen@gmail.com, kenny.bachman17@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Postgresql 14 performance
  In-Reply-To: <df274234-9553-c09c-52ed-79127716ec99@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox