RE: Shared Memory: How to use SYSV rather than MMAP ?

From: "REIX, Tony" <tony(dot)reix(at)atos(dot)net>
To: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
Cc: "EMPEREUR-MOT, SYLVIE" <sylvie(dot)empereur-mot(at)atos(dot)net>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: Shared Memory: How to use SYSV rather than MMAP ?
Date: 2019-02-07 14:18:04
Message-ID: DB7PR02MB4663C748E4C5A199FFBD8EFC86680@DB7PR02MB4663.eurprd02.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

Hi Thomas,

Thanks for your help,

Here are my experiments on the AIX 7.2 machine.

That sounds good !

About "huge", we have plans for AIX. But it is not urgent. Let's go with this patch.

Regards,

Tony

Buffers for SharedMemory PSIZ has been extended by:

ldedit -btextpsize=64k -bdatapsize=64k -bstackpsize=64k /opt/freeware/bin/postgres_64

1) shm: mmap / huge: try

$PGDATA/postgresql.conf :

dynamic_shared_memory_type = mmap
shared_memory_type = mmap
huge_pages = try

$ psql -U postgres -x -f pg_showSystVParams.sql
-[ RECORD 1 ]------+-----
shared_memory_type | mmap

-[ RECORD 1 ]--------------+-----
dynamic_shared_memory_type | mmap

-[ RECORD 1 ]---
huge_pages | try

Procmap :

Start-ADD End-ADD SIZE MODE PSIZ TYPE VSID MAPPED OBJECT

+ grep SMMAP /tmp/PG.procmap
a00000000000000 a00000008dca000 145192K rw- sm SMMAP 8ce86c
+ grep MAIN /tmp/PG.procmap
100000000 10090c883 9266K r-x m MAINTEXT 8a62ea postgres_64
1100009ea 1100f7500 986K rw- m MAINDATA 836822 postgres_64
+ grep SHM /tmp/PG.procmap
a00010000000000 a00010000010000 64K rw- m SHM 81b5e1 shmid:138413056

2) shm: mmap / huge: on

$PGDATA/postgresql.conf :

dynamic_shared_memory_type = mmap
shared_memory_type = mmap
huge_pages = on

$ pg_ctl start :
FATAL: huge pages not supported on this platform

3) shm: mmap / huge: try

$PGDATA/postgresql.conf :

dynamic_shared_memory_type = mmap
shared_memory_type = mmap
huge_pages = try

$ pg_ctl start : OK - No message

4) shm: sysv / huge: off

dynamic_shared_memory_type = sysv
shared_memory_type = sysv
huge_pages = off

$ psql -U postgres -x -f pg_showSystVParams.sql
-[ RECORD 1 ]------+-----
shared_memory_type | sysv

-[ RECORD 1 ]--------------+-----
dynamic_shared_memory_type | sysv

-[ RECORD 1 ]---
huge_pages | off

Procmap :

+ grep SMMAP /tmp/PG.procmap
+ grep MAIN /tmp/PG.procmap
100000000 10090c883 9266K r-x m MAINTEXT 886229 postgres_64
1100009ea 1100f7500 986K rw- m MAINDATA 8ee2ce postgres_64
+ grep SHM /tmp/PG.procmap
a00000000000000 a00000008dd0000 145216K rw- m SHM 8745c7 shmid:139461632
a00000010000000 a00000010010000 64K rw- m SHM 80b380 shmid:685769729

5) shm: sysv / huge: on

FATAL: huge pages not supported on this platform

6) shm: sysv / huge: try

$ pg_ctl start : OK - No message

# cat procmapcheck.sh
PID=` ps -edf | grep /opt/freeware/bin/postgres | grep " 1" | awk '{print $2}'`
procmap -nfX > /tmp/PG.procmap $PID
grep SMMAP /tmp/PG.procmap
grep MAIN /tmp/PG.procmap
grep SHM /tmp/PG.procmap

$ cat pg_showSystVParams.sql
SHOW shared_memory_type;
SHOW dynamic_shared_memory_type;
SHOW huge_pages;

Cordialement,

Tony Reix

tony(dot)reix(at)atos(dot)net

ATOS / Bull SAS
ATOS Expert
IBM Coop Architect & Technical Leader
Office : +33 (0) 4 76 29 72 67
1 rue de Provence - 38432 Échirolles - France
www.atos.net<https://mail.ad.bull.net/owa/redir.aspx?C=PvphmPvCZkGrAgHVnWGsdMcDKgzl_dEIsM6rX0g4u4v8V81YffzBGkWrtQeAXNovd3ttkJL8JIc.&URL=http%3a%2f%2fwww.atos.net%2f>

________________________________
De : Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
Envoyé : jeudi 7 février 2019 03:30
À : REIX, Tony
Cc : EMPEREUR-MOT, SYLVIE
Objet : Re: Shared Memory: How to use SYSV rather than MMAP ?

On Thu, Feb 7, 2019 at 4:08 AM REIX, Tony <tony(dot)reix(at)atos(dot)net> wrote:
> I've been able to build/install/test the version 11.1 with your patch, on AIX 7.2 .
>
>
> I've changed the postgresql.conf file we use for our benchmark, and I've checked that, when starting postgres, it reads this file.
>
> However, I'm not sure that it takes into account the values that I have set. Or maybe the "postgres --describe-config" command does not do what I am expecting (print the value of all the parameters set in the postgresql.conf file)?

SHOW shared_memory_type;
SHOW dynamic_shared_memory_type;

Maybe you can also see a difference in the output of "procmap" for a
backend process? I am not sure about that.

--
Thomas Munro
https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.enterprisedb.com&amp;data=02%7C01%7Ctony.reix%40atos.net%7C1f0898d2c4fe4073023908d68ca45bcc%7C33440fc6b7c7412cbb730e70b0198d5a%7C0%7C0%7C636851034874173812&amp;sdata=Jre8GiJFU%2FobP3K6xsYrV9dOg2nS7%2F7y9J81fDqTwJg%3D&amp;reserved=0

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Sergei Kornilov 2019-02-07 14:28:05 Re: REINDEX CONCURRENTLY 2.0
Previous Message Tels 2019-02-07 12:55:32 Re: Tighten up a few overly lax regexes in pg_dump's tap tests