We are installing postgres on a MacOS X Server...

On our Linux box, we had to muddle with some parameters to be able to
increase the shared memory and buffers in postgres.

Does anyone know how to do this in OS X? Or is it required?

Thanks,
Hunter


Sun, 20 Oct 2002 12:05:04 -0700
Hunter Hillegas <lists@lastonepicked.com>
Buffers and MacOS X 
Hunter Hillegas <lists@lastonepicked.com> writes:
> We are installing postgres on a MacOS X Server...
> On our Linux box, we had to muddle with some parameters to be able to
> increase the shared memory and buffers in postgres.
> Does anyone know how to do this in OS X? Or is it required?

In OS X 10.1, the max shared memory was a hardwired number that couldn't
be changed without recompiling the kernel --- and the standard setting
was none too darn large, either :-(.  I dunno if Apple has improved
matters in 10.2.

			regards, tom lane

Sun, 20 Oct 2002 20:48:31 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: Buffers and MacOS X 
Tom Lane wrote:
> Hunter Hillegas <lists@lastonepicked.com> writes:
> > We are installing postgres on a MacOS X Server...
> > On our Linux box, we had to muddle with some parameters to be able to
> > increase the shared memory and buffers in postgres.
> > Does anyone know how to do this in OS X? Or is it required?
> 
> In OS X 10.1, the max shared memory was a hardwired number that couldn't
> be changed without recompiling the kernel --- and the standard setting
> was none too darn large, either :-(.  I dunno if Apple has improved
> matters in 10.2.

I was going to point him to the development docs, but I see no mention
of OSX shared kernel limit tuning in there at all.  Can someone submit
info to beef it up for OSX?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Sun, 20 Oct 2002 21:13:29 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: Buffers and MacOS X
>Tom Lane wrote:
>> Hunter Hillegas <lists@lastonepicked.com> writes:
>> > We are installing postgres on a MacOS X Server...
>> > On our Linux box, we had to muddle with some parameters to be able to
>> > increase the shared memory and buffers in postgres.
>> > Does anyone know how to do this in OS X? Or is it required?
>>
>> In OS X 10.1, the max shared memory was a hardwired number that couldn't
>> be changed without recompiling the kernel --- and the standard setting
>> was none too darn large, either :-(.  I dunno if Apple has improved
>> matters in 10.2.
>
>I was going to point him to the development docs, but I see no mention
>of OSX shared kernel limit tuning in there at all.  Can someone submit
>info to beef it up for OSX?


Here are instructions for setting shared memory limits on Mac OS X 10.2.

Edit the file:

	/System/Library/StartupItems/SystemTuning/SystemTuning

Near the bottom, you will see these lines:

    sysctl -w kern.sysv.shmmax=4194304
    sysctl -w kern.sysv.shmmin=1
    sysctl -w kern.sysv.shmmni=32
    sysctl -w kern.sysv.shmseg=8
    sysctl -w kern.sysv.shmall=1024

These parameters are described in this document:

	http://www.postgresql.org/idocs/index.php?kernel-resources.html

OS X is simialar to BSD/OS in the values for each parameter.  For my system, I want PostgreSQL to use 128MB worth of buffers.  I used the calculations provided in the "Reasonable Values" column of the parameters table in the document above.

So here are my settings (allowing a little extra room):

    sysctl -w kern.sysv.shmmax=167772160	# bytes
    sysctl -w kern.sysv.shmmin=1
    sysctl -w kern.sysv.shmmni=32
    sysctl -w kern.sysv.shmseg=8
    sysctl -w kern.sysv.shmall=65536		# 4K pages

Now, I can set shared_buffers in postgresql.conf to:

	shared_buffers = 16384	# number of buffers, 8K each

- Jeff
-- 

Jeff Bohmer
VisionLink, Inc.
_________________________________
303.402.0170
www.visionlink.org
_________________________________
People. Tools. Change. Community.

Mon, 21 Oct 2002 10:08:52 -0600
Jeffrey Bohmer <bohmer@visionlink.org>
Re: Buffers and MacOS X

Added to 7.3 documentation. Thanks.

---------------------------------------------------------------------------

Jeffrey Bohmer wrote:
> >Tom Lane wrote:
> >> Hunter Hillegas <lists@lastonepicked.com> writes:
> >> > We are installing postgres on a MacOS X Server...
> >> > On our Linux box, we had to muddle with some parameters to be able to
> >> > increase the shared memory and buffers in postgres.
> >> > Does anyone know how to do this in OS X? Or is it required?
> >>
> >> In OS X 10.1, the max shared memory was a hardwired number that couldn't
> >> be changed without recompiling the kernel --- and the standard setting
> >> was none too darn large, either :-(.  I dunno if Apple has improved
> >> matters in 10.2.
> >
> >I was going to point him to the development docs, but I see no mention
> >of OSX shared kernel limit tuning in there at all.  Can someone submit
> >info to beef it up for OSX?
> 
> 
> Here are instructions for setting shared memory limits on Mac OS X 10.2.
> 
> Edit the file:
> 
> 	/System/Library/StartupItems/SystemTuning/SystemTuning
> 
> Near the bottom, you will see these lines:
> 
>     sysctl -w kern.sysv.shmmax=4194304
>     sysctl -w kern.sysv.shmmin=1
>     sysctl -w kern.sysv.shmmni=32
>     sysctl -w kern.sysv.shmseg=8
>     sysctl -w kern.sysv.shmall=1024
> 
> These parameters are described in this document:
> 
> 	http://www.postgresql.org/idocs/index.php?kernel-resources.html
> 
> OS X is simialar to BSD/OS in the values for each parameter.  For my system, I want PostgreSQL to use 128MB worth of buffers.  I used the calculations provided in the "Reasonable Values" column of the parameters table in the document above.
> 
> So here are my settings (allowing a little extra room):
> 
>     sysctl -w kern.sysv.shmmax=167772160	# bytes
>     sysctl -w kern.sysv.shmmin=1
>     sysctl -w kern.sysv.shmmni=32
>     sysctl -w kern.sysv.shmseg=8
>     sysctl -w kern.sysv.shmall=65536		# 4K pages
> 
> Now, I can set shared_buffers in postgresql.conf to:
> 
> 	shared_buffers = 16384	# number of buffers, 8K each
> 
> - Jeff
> -- 
> 
> Jeff Bohmer
> VisionLink, Inc.
> _________________________________
> 303.402.0170
> www.visionlink.org
> _________________________________
> People. Tools. Change. Community.
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Tue, 5 Nov 2002 18:16:37 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: Buffers and MacOS X