svn commit: r280323 - head/sys/kern

Jos Backus jos at catnook.com
Sun Mar 22 19:28:33 UTC 2015


On Mar 22, 2015 5:11 AM, "Dmitry Morozovsky" <marck at 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 at FreeBSD.org ]
> ------------------------------------------------------------------------
> *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck at rinet.ru ***
> ------------------------------------------------------------------------
> _______________________________________________
> svn-src-head at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/svn-src-head
> To unsubscribe, send any mail to "svn-src-head-unsubscribe at freebsd.org"


More information about the svn-src-all mailing list