Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Mar 2015 12:28:25 -0700
From:      Jos Backus <jos@catnook.com>
To:        svn-src-head@freebsd.org
Cc:        Konstantin Belousov <kostikbel@gmail.com>, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r280323 - head/sys/kern
Message-ID:  <CAETOPp068RyznSjBDJgwxdHcb3Oq59Ua8kHZFMjMuoetT=hm6g@mail.gmail.com>
In-Reply-To: <alpine.BSF.2.00.1503221509370.71864@woozle.rinet.ru>
References:  <201503211501.t2LF1Kj8052521@svn.freebsd.org> <20150321210341.GC15857@lonesome.com> <20150321210810.GT2379@kib.kiev.ua> <alpine.BSF.2.00.1503220014150.60253@woozle.rinet.ru> <20150321212416.GU2379@kib.kiev.ua> <alpine.BSF.2.00.1503221509370.71864@woozle.rinet.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mar 22, 2015 5:11 AM, "Dmitry Morozovsky" <marck@rinet.ru> wrote:
>
> On Sat, 21 Mar 2015, Konstantin Belousov wrote:
>
> > > > > >   Somewhat modernize the SysV shm code:
> > > > >
> > > > > Is my understanding correct that postgres still uses shm?  If so,
> > > > > has someone benchmarked the speedup?
> > > >
> > > > Yes, some versions of Postgres still use SysV shm.
> > >
> > > To be clarified: IIUC, *all* contemporary versions of PostgreSQL do
> > > use SHM for shatrd buffers (as PgSQL use process-per-connection model)
> >
> > No.  Recent versions use mmaped shared region for buffers.
>
> Yes, starting from 9.3 main buffers are memory-mapped.  SysV SHM and
Semaphores
> *are* still in use though.

To expand on this a little bit:

A small amount of SysV shared memory and semaphores are still used to
manage safe and crash-proof access to the shared buffers between the
postmaster and the client instances and other worker processes that need
access to said buffers. My understanding from discussions on the PostgreSQL
hackers list is that POSIX shared memory doesn't have the behavior needed
to provide the same guarantees required. The change to use mmap()-ed memory
was done to help people avoid having to change their SysV IPC resource
limits, since these tend to have to be statically allocated, and are often
too low to run PostgreSQL well or at all.

This is to the best of my understanding. I'm not a PostgreSQL developer, so
I could be wrong, in which case, please correct me.

Jos

> (mainly for search engines)
>
> Thanks for the clarification.
>
> --
> Sincerely,
> D.Marck                                     [DM5020, MCK-RIPE, DM3-RIPN]
> [ FreeBSD committer:                                 marck@FreeBSD.org ]
> ------------------------------------------------------------------------
> *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru ***
> ------------------------------------------------------------------------
> _______________________________________________
> svn-src-head@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/svn-src-head
> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAETOPp068RyznSjBDJgwxdHcb3Oq59Ua8kHZFMjMuoetT=hm6g>