Correction to documentation at https://www.postgresql.org/docs/12/kernel-resources.html

Started by PG Bug reporting formover 4 years ago4 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/12/kernel-resources.html
Description:

Hi.

On https://www.postgresql.org/docs/12/kernel-resources.html, the command to
calculate memory allocated to postgres is not correct. Following is the
command as shown in 18.4.5. Linux Huge Pages.

pmap 4170 | awk '/rw-s/ && /zero/ {print $2}', this command does not return
any results with correct pid. Probably /zero/ needs to be updated with
/anon_hugepage/

Thanks,
Sanjeev Adwal

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: PG Bug reporting form (#1)
Re: Correction to documentation at https://www.postgresql.org/docs/12/kernel-resources.html

PG Doc comments form <noreply@postgresql.org> writes:

On https://www.postgresql.org/docs/12/kernel-resources.html, the command to
calculate memory allocated to postgres is not correct. Following is the
command as shown in 18.4.5. Linux Huge Pages.
pmap 4170 | awk '/rw-s/ && /zero/ {print $2}', this command does not return
any results with correct pid. Probably /zero/ needs to be updated with
/anon_hugepage/

The example seems to work as-given for me (testing on a RHEL8 system).
It's of course not guaranteed to work on every flavor of Linux.

regards, tom lane

#3Thomas Munro
thomas.munro@gmail.com
In reply to: Tom Lane (#2)
Re: Correction to documentation at https://www.postgresql.org/docs/12/kernel-resources.html

On Wed, Oct 6, 2021 at 3:48 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:

PG Doc comments form <noreply@postgresql.org> writes:

On https://www.postgresql.org/docs/12/kernel-resources.html, the command to
calculate memory allocated to postgres is not correct. Following is the
command as shown in 18.4.5. Linux Huge Pages.
pmap 4170 | awk '/rw-s/ && /zero/ {print $2}', this command does not return
any results with correct pid. Probably /zero/ needs to be updated with
/anon_hugepage/

The example seems to work as-given for me (testing on a RHEL8 system).
It's of course not guaranteed to work on every flavor of Linux.

I think the pattern as given will show you the size if you are not
already using huge pages. For example, this line matches on my system
when I have /proc/sys/vm/nr_hugepages == 0:

00007f2932eb6000 145360K rw-s- zero (deleted)

If you are already using huge pages, it doesn't match anything,
because the relevant line looks like:

00007f6814e00000 145408K rw-s- anon_hugepage (deleted)

#4Sanjeev Adwal
sanjeev_adwal@yahoo.co.in
In reply to: Thomas Munro (#3)
Re: Correction to documentation at https://www.postgresql.org/docs/12/kernel-resources.html

Thanks Thomas. Looks like I misread that.
On Wednesday, 6 October, 2021, 04:56:42 am IST, Thomas Munro <thomas.munro@gmail.com> wrote:

On Wed, Oct 6, 2021 at 3:48 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:

PG Doc comments form <noreply@postgresql.org> writes:

On https://www.postgresql.org/docs/12/kernel-resources.html, the command to
calculate memory allocated to postgres is not correct. Following is the
command as shown in 18.4.5. Linux Huge Pages.
pmap 4170 | awk '/rw-s/ && /zero/ {print $2}', this command does not return
any results with correct pid. Probably /zero/ needs to be updated with
/anon_hugepage/

The example seems to work as-given for me (testing on a RHEL8 system).
It's of course not guaranteed to work on every flavor of Linux.

I think the pattern as given will show you the size if you are not
already using huge pages.  For example, this line matches on my system
when I have /proc/sys/vm/nr_hugepages == 0:

00007f2932eb6000 145360K rw-s- zero (deleted)

If you are already using huge pages, it doesn't match anything,
because the relevant line looks like:

00007f6814e00000 145408K rw-s- anon_hugepage (deleted)