pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
configure shmmax on MAC OS X
5+ messages / 4 participants
[nested] [flat]

* configure shmmax on MAC OS X
@ 2004-04-13 18:49  Qing Zhao <qzhao@quotefx.net>
  0 siblings, 2 replies; 5+ messages in thread

From: Qing Zhao @ 2004-04-13 18:49 UTC (permalink / raw)
  To: pgsql-performance; +Cc: Qing Zhao <qzhao@quotefx.net>


Hi, all,

I have got a new MaC OS G5 with 8GB RAM. So i tried to increase
the shmmax in Kernel so that I can take advantage of the RAM.

I searched the web and read the manual for PG7.4 chapter 16.5.1.
After that, I edited /etc/rc file:

sysctl -w kern.sysv.shmmax=4294967296 // byte
sysctl -w kern.sysv.shmmin=1
sysctl -w kern.sysv.shmmni=32
sysctl -w kern.sysv.shmseg=8
sysctl -w kern.sysv.shmall=1048576 //4kpage

for 4G shared RAM.

Then I changed postgresql.conf:
shared_buffer=100000 //could be bigger?

and restart the machine and postgres server. To my surprise, postgres 
server wouldn't
start, saying that the requested shared memory exceeds kernel's shmmax.

My suspision is that the change i made in /etc/rc does not take 
effect.Is there a way
to check it?  Is there an
up limit for how much RAM can be allocated for shared buffer in MAC OS 
X? Or
is there something wrong with my calculation in numbers?

Thanks a lot!

Qing




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: configure shmmax on MAC OS X
@ 2004-04-13 19:25  Jeff Bohmer <bohmer@visionlink.org>
  parent: Qing Zhao <qzhao@quotefx.net>
  1 sibling, 0 replies; 5+ messages in thread

From: Jeff Bohmer @ 2004-04-13 19:25 UTC (permalink / raw)
  To: Qing Zhao <qzhao@quotefx.net>; +Cc: pgsql-performance


On OS X, I've always made these changes in:

/System/Library/StartupItems/SystemTuning/SystemTuning

and manually checked it with sysctl after reboot.  Works for me.

100k buffers is probably overkill.  There can be a performance penalty with too many buffers.  See this lists' archives for more.  10k would probably be a better start.

- Jeff


>Hi, all,
>
>I have got a new MaC OS G5 with 8GB RAM. So i tried to increase
>the shmmax in Kernel so that I can take advantage of the RAM.
>
>I searched the web and read the manual for PG7.4 chapter 16.5.1.
>After that, I edited /etc/rc file:
>
>sysctl -w kern.sysv.shmmax=4294967296 // byte
>sysctl -w kern.sysv.shmmin=1
>sysctl -w kern.sysv.shmmni=32
>sysctl -w kern.sysv.shmseg=8
>sysctl -w kern.sysv.shmall=1048576 //4kpage
>
>for 4G shared RAM.
>
>Then I changed postgresql.conf:
>shared_buffer=100000 //could be bigger?
>
>and restart the machine and postgres server. To my surprise, postgres server wouldn't
>start, saying that the requested shared memory exceeds kernel's shmmax.
>
>My suspision is that the change i made in /etc/rc does not take effect.Is there a way
>to check it?  Is there an
>up limit for how much RAM can be allocated for shared buffer in MAC OS X? Or
>is there something wrong with my calculation in numbers?
>
>Thanks a lot!
>
>Qing
>
>
>---------------------------(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


-- 

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



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: configure shmmax on MAC OS X
@ 2004-04-13 19:55  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Qing Zhao <qzhao@quotefx.net>
  1 sibling, 2 replies; 5+ messages in thread

From: Tom Lane @ 2004-04-13 19:55 UTC (permalink / raw)
  To: Qing Zhao <qzhao@quotefx.net>; +Cc: pgsql-performance

Qing Zhao <qzhao@quotefx.net> writes:
> My suspision is that the change i made in /etc/rc does not take 
> effect.Is there a way to check it?

sysctl has an option to show the values currently in effect.

I believe that /etc/rc is the correct place to set shmmax on OSX 10.3 or
later ... but we have seen prior reports of people having trouble
getting the setting to "take".  There may be some other constraint
involved.

> sysctl -w kern.sysv.shmmax=4294967296 // byte

Hmm, does sysctl work for values that exceed the range of int?

There's no particularly good reason to try to set shmmax as high as you
are trying anyhow; you really don't need more than a couple hundred meg
in Postgres shared memory.  It's better to leave the kernel to manage
the bulk of your RAM.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: configure shmmax on MAC OS X
@ 2004-04-13 20:10  Qing Zhao <qzhao@quotefx.net>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 5+ messages in thread

From: Qing Zhao @ 2004-04-13 20:10 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-performance

Tom:

I used sysctl -A to see the kernel state, I got:
kern.sysv.shmmax: -1

It looks the value is too big!

Thanks!

Qing
On Apr 13, 2004, at 12:55 PM, Tom Lane wrote:

> Qing Zhao <qzhao@quotefx.net> writes:
>> My suspision is that the change i made in /etc/rc does not take
>> effect.Is there a way to check it?
>
> sysctl has an option to show the values currently in effect.
>
> I believe that /etc/rc is the correct place to set shmmax on OSX 10.3 
> or
> later ... but we have seen prior reports of people having trouble
> getting the setting to "take".  There may be some other constraint
> involved.
>
>> sysctl -w kern.sysv.shmmax=4294967296 // byte
>
> Hmm, does sysctl work for values that exceed the range of int?
>
> There's no particularly good reason to try to set shmmax as high as you
> are trying anyhow; you really don't need more than a couple hundred meg
> in Postgres shared memory.  It's better to leave the kernel to manage
> the bulk of your RAM.
>
> 			regards, tom lane
>




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: configure shmmax on MAC OS X
@ 2004-04-13 20:59  Joshua D. Drake <jd@commandprompt.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 5+ messages in thread

From: Joshua D. Drake @ 2004-04-13 20:59 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Qing Zhao <qzhao@quotefx.net>; pgsql-performance

Hello,

I found that if you SHMALL value was less than your SHMMAX value,
the value wouldn't take.

J


Tom Lane wrote:

> Qing Zhao <qzhao@quotefx.net> writes:
> 
>>My suspision is that the change i made in /etc/rc does not take 
>>effect.Is there a way to check it?
> 
> 
> sysctl has an option to show the values currently in effect.
> 
> I believe that /etc/rc is the correct place to set shmmax on OSX 10.3 or
> later ... but we have seen prior reports of people having trouble
> getting the setting to "take".  There may be some other constraint
> involved.
> 
> 
>>sysctl -w kern.sysv.shmmax=4294967296 // byte
> 
> 
> Hmm, does sysctl work for values that exceed the range of int?
> 
> There's no particularly good reason to try to set shmmax as high as you
> are trying anyhow; you really don't need more than a couple hundred meg
> in Postgres shared memory.  It's better to leave the kernel to manage
> the bulk of your RAM.
> 
> 			regards, tom lane
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2004-04-13 20:59 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-04-13 18:49 configure shmmax on MAC OS X Qing Zhao <qzhao@quotefx.net>
2004-04-13 19:25 ` Jeff Bohmer <bohmer@visionlink.org>
2004-04-13 19:55 ` Tom Lane <tgl@sss.pgh.pa.us>
2004-04-13 20:10   ` Qing Zhao <qzhao@quotefx.net>
2004-04-13 20:59   ` Joshua D. Drake <jd@commandprompt.com>

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