Re: Increasing Max Connections Mac OS 10.3 - Mailing list pgsql-general

From Joe Lester
Subject Re: Increasing Max Connections Mac OS 10.3
Date
Msg-id 347BF674-5B4E-11D8-9282-000A95A58EA0@sweetwater.com
Whole thread Raw
In response to Re: Increasing Max Connections Mac OS 10.3  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Increasing Max Connections Mac OS 10.3  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
<excerpt>Joe Lester <<joe_lester@sweetwater.com> writes:

<excerpt>That's odd. It's giving me a -1 for the shmmax value. I
assume that's

NOT normal. Why would that be?

</excerpt>

It's not --- you should get back the same value you set.  I speculate

that you tried to set a value that exceeded some internal sanity check

in the kernel.  I wouldn't be too surprised if the kernel rejects
values

larger than available RAM, for instance.

</excerpt>

I tried a few different things to try to get the shmmax value to be
something other than 4194304 (the default in /etc/rc).


First, I restarted my mac, then, as the root user...


<bold>I tried setting it to a "high" number:</bold>

[lester2:~] root# sysctl -w kern.sysv.shmmax=9194304

kern.sysv.shmmax: -1


No luck. It set it back to -1


<bold>Then I tried setting it to a "low" number:</bold>

[lester2:~] root# sysctl -w kern.sysv.shmmax=3194304

kern.sysv.shmmax: -1


Still no action.


<bold>Then I tried setting it to 4194304 (the default in /etc/rc):</bold>

[lester2:~] root# sysctl -w kern.sysv.shmmax=4194304

kern.sysv.shmmax: -1 -> 4194304


It took this time! BUT... I need to increase the number because my
postgres error log is telling me that it needs to be at least 4620288:


DETAIL:  Failed system call was shmget(key=5432001, size=4620288,
03600).

HINT:  This error usually means that PostgreSQL's request for a shared
memory segment exceeded your kernel's SHMMAX parameter.  You can
either reduce the request size or reconfigure the kernel with larger
SHMMAX.  To reduce the request size (currently 4620288 bytes), reduce
PostgreSQL's shared_buffers parameter (currently 300) and/or its
max_connections parameter (currently 100).


Any ideas? Again, I am running Mac OS 10.3.2 and Postgres 7.4.1 on a
dual processor G5. Thanks.

> Joe Lester <joe_lester@sweetwater.com> writes:
>> That's odd. It's giving me a -1 for the shmmax value. I assume that's
>> NOT normal. Why would that be?
>
> It's not --- you should get back the same value you set.  I speculate
> that you tried to set a value that exceeded some internal sanity check
> in the kernel.  I wouldn't be too surprised if the kernel rejects
> values
> larger than available RAM, for instance.

I tried a few different things to try to get the shmmax value to be
something other than 4194304 (the default in /etc/rc).

First, I restarted my mac, then, as the root user...

I tried setting it to a "high" number:
[lester2:~] root# sysctl -w kern.sysv.shmmax=9194304
kern.sysv.shmmax: -1

No luck. It set it back to -1

Then I tried setting it to a "low" number:
[lester2:~] root# sysctl -w kern.sysv.shmmax=3194304
kern.sysv.shmmax: -1

Still no action.

Then I tried setting it to 4194304 (the default in /etc/rc):
[lester2:~] root# sysctl -w kern.sysv.shmmax=4194304
kern.sysv.shmmax: -1 -> 4194304

It took this time! BUT... I need to increase the number because my
postgres error log is telling me that it needs to be at least 4620288:

DETAIL:  Failed system call was shmget(key=5432001, size=4620288,
03600).
HINT:  This error usually means that PostgreSQL's request for a shared
memory segment exceeded your kernel's SHMMAX parameter.  You can either
reduce the request size or reconfigure the kernel with larger SHMMAX.
To reduce the request size (currently 4620288 bytes), reduce
PostgreSQL's shared_buffers parameter (currently 300) and/or its
max_connections parameter (currently 100).

Any ideas? Again, I am running Mac OS 10.3.2 and Postgres 7.4.1 on a
dual processor G5. Thanks.

pgsql-general by date:

Previous
From: Paul Thomas
Date:
Subject: Re: I want to use postresql for this app, but...
Next
From: Bruce Momjian
Date:
Subject: Re: db_space