pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: stadtkind2@gmx.de
To: pgsql-bugs@postgresql.org
Subject: BUG #13416: Postgres >= 9.3 doesn't use optimized shared memory on Solaris anymore
Date: Mon, 08 Jun 2015 13:24:32 +0000
Message-ID: <20150608132432.2796.77742@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      13416
Logged by:          Stefan Krüger
Email address:      stadtkind2@gmx.de
PostgreSQL version: 9.4.1
Operating system:   Solaris 11.2
Description:        

Hi,

starting with Postgres 9.3, there seems to be a bug with SysV Shared Memory
on Solaris. Postgres doesn't seem to use ISM anymore.

http://docs.oracle.com/cd/E23824_01/html/821-1450/chapter2-73.html

"A special kind of shared memory known as intimate shared memory (ISM) is
used by DBMS vendors to maximize performance.
When a shared memory segment is made into an ISM segment, the memory for the
segment is locked.
This feature enables a faster I/O path to be followed and improves memory
usage.
A number of kernel resources describing the segment are then shared between
all processes that attach to the segment in ISM mode"

I'm using Solaris 11.2 on Sparc (T5220) and the "official" solaris11/sparc
binaries from your site.

PostgreSQL 9.4.1:

"dynamic_shared_memory_type" was set to sysv (also tried 'posix' and 'mmap',
same results)

root@solaris:/ # ipcs -mA
IPC status from <running system> as of Wednesday, February 18, 2015 02:04:56
PM CET
T         ID      KEY        MODE        OWNER    GROUP  CREATOR   CGROUP
NATTCH      SEGSZ   CPID  LPID   ATIME    DTIME    CTIME  ISMATTCH        
PROJECT
Shared Memory:
m         49   0x7be9c1bd --rw------- postgres postgres postgres postgres   
  4       2316  1726  2809 13:22:02 16:55:41 13:22:02        4  
user.postgres
m         48   0x52e2c1   --rw------- postgres postgres postgres postgres   
  4         56  1726  2809 13:22:00 16:55:41 13:22:00        4  
user.postgres

root@solaris:/ # pmap -sx 1726
         Address     Kbytes        RSS       Anon     Locked Pgsz Mode  
Mapped File
...
00007FFEFF000000          8          8          -          8   8K rwxsR    [
ism shmid=0x32 ]
00007FFEFF800000          8          8          -          8   8K rwxsR    [
ism shmid=0x33 ]
FFFFFFFB50000000     282624     282624          -          -   4M rw-s-    [
anon ]
FFFFFFFB61400000   16773120    7290880          -          -    - rw-s-    [
anon ]
FFFFFFFF61000000     159744     159744          -          -   4M rw-s-    [
anon ]


Notice that there are 2 ISM's, but they're way too small. All the "fun"
happens in an anonymous memory region
which does not benefit from large(r) page support (anon memory seems to be
limited to 4MB pages,
whereas ISM can use up to 2 GB pages on certain SPARC CPUs).

PostgreSQL 9.2.10 is fine though:

root@solaris:/ # ipcs -mA
IPC status from <running system> as of Wednesday, February 18, 2015 02:08:49
PM CET
T         ID      KEY        MODE        OWNER    GROUP  CREATOR   CGROUP
NATTCH      SEGSZ   CPID  LPID   ATIME    DTIME    CTIME  ISMATTCH        
PROJECT
Shared Memory:
m         50   0x52e2c1   --rw------- postgres postgres postgres postgres   
  4 17605672960 18225 18232 14:08:42 14:08:43 14:08:40        4  
user.postgres

Notice the huge SEGSZ!

root@solaris:/ # pmap -sx 18225 | grep ism
         Address     Kbytes        RSS       Anon     Locked Pgsz Mode  
Mapped File
...
00007FFAE0000000   17039360   17039360          -   17039360 256M rwxsR    [
ism shmid=0x32 ]
00007FFEF0000000     151552     151552          -     151552   4M rwxsR    [
ism shmid=0x32 ]
00007FFEF9400000       2112       2112          -       2112  64K rwxsR    [
ism shmid=0x32 ]
00007FFEF9610000         16         16          -         16   8K rwxsR    [
ism shmid=0x32 ]

This looks good.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (5+ messages)  latest in thread

Message-ID: <20150608132432.2796.77742@wrigleys.postgresql.org>
Permalink:  ../20150608132432.2796.77742@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20150608132432.2796.77742@wrigleys.postgresql.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: stadtkind2@gmx.de
  Subject: Re: BUG #13416: Postgres >= 9.3 doesn't use optimized shared memory on Solaris anymore
  In-Reply-To: <20150608132432.2796.77742@wrigleys.postgresql.org>
  References: <20150608132432.2796.77742@wrigleys.postgresql.org>

* 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