Re: SHMMAX seems entirely broken in OS X 10.4.2

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Luke Lonergan" <llonergan(at)greenplum(dot)com>
Cc: "Jeff Trout" <threshar(at)torgo(dot)978(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: SHMMAX seems entirely broken in OS X 10.4.2
Date: 2005-10-16 20:49:19
Message-ID: 10265.1129495759@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

[ resuming an old thread ]

"Luke Lonergan" <llonergan(at)greenplum(dot)com> writes:
> I also tried different settings (shmall set to 500K) and shmmax ended up at
> -1. So, it seems that shmall is in pages. I didn't try other allowable
> configs, which was a problem before.

I went back and experimented some more with this issue, and I believe
I've finally nailed down what the problem is: as of 10.4.something, OS X
rejects attempts to set SHMMAX to anything that isn't an exact multiple
of the page size (4096). Every other Unix on the planet, including
earlier versions of OS X, will round off the value to whatever unit
they feel like supporting ... but not Tiger. Thanks for this usability
improvement, Apple.

Also, the /etc/sysctl.conf file is utterly useless for setting SHM
settings in 10.4.2, because whatever it sets will be overridden by the
sysctl command that /etc/rc does just after reading /etc/sysctl.conf.
Perhaps in prior versions, the behavior was "first set wins" ... but
now it is definitely "last set wins". (SHMMAX eventually gets locked
down and can't be changed anymore; I'm not sure what triggers that,
but the sysctl in /etc/rc definitely gets to change what you put in
/etc/sysctl.conf.) Perhaps Apple can be persuaded to change the order
of these operations in /etc/rc, but until they do there is no point
in suggesting that people use /etc/sysctl.conf.

Bottom line: in 10.4.2, you have to edit /etc/rc to adjust SHMMAX,
and you'd better be sure it is an exact multiple of 4096.

I'll add a note about this to our documentation.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2005-10-16 20:55:12 Re: FYI: PotgreSQL and SQL standards commentary WWW page
Previous Message Andrew Dunstan 2005-10-16 20:06:04 Re: Question about Ctrl-C and less