7.4 on Mac OS X 10.3 (Panther): initdb shmget fails

From: Steffen Schmidt <Schmidt(at)EMBL(dot)de>
To: pgsql-ports(at)postgresql(dot)org
Subject: 7.4 on Mac OS X 10.3 (Panther): initdb shmget fails
Date: 2003-11-25 15:43:12
Message-ID: 13D857C3-1F5E-11D8-9584-000A956B0EB8@EMBL.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-ports

Hi,

I successfully compiled the 7.4 version on my machine but I run into
the shared memory problem:

The files belonging to this database system will be owned by user
"hallo".
This user must also own the server process.

The database cluster will be initialized with locale C.

fixing permissions on existing directory /Users/hallo/PgSQL... ok
creating directory /Users/hallo/PgSQL/base... ok
creating directory /Users/hallo/PgSQL/global... ok
creating directory /Users/hallo/PgSQL/pg_xlog... ok
creating directory /Users/hallo/PgSQL/pg_clog... ok
selecting default max_connections... 10
selecting default shared_buffers... 50
creating configuration files... ok
creating template1 database in /Users/hallo/PgSQL/base/1... FATAL:
could not create shared memory segment: Cannot allocate memory
DETAIL: Failed system call was shmget(key=1, size=1081344, 03600).
HINT: This error usually means that PostgreSQL's request for a shared
memory segment exceeded available memory or swap space. To reduce the
request size (currently 1081344 bytes), reduce PostgreSQL's
shared_buffers parameter (currently 50) and/or its max_connections
parameter
(currently 10).
The PostgreSQL documentation contains more information about shared
memory configuration.

I found some newsgroup discussions / documentation about this issue but
still there are some problems and I'd like to know the proper way to
solve this problem.

Solution 1:
The solution I found was increasing the kernel kern.sysv.shmmax flag
(i.e. editing the /etc/rc file and rebooting). But this is not a nice
solution as my older postgres 7.3.4 daemon now doesn't start because of
the same issue :-( - and I want to keep this daemon for a while

Solution 2 (?):
There are also the -N -B flags mentioned in the discussions. I modified
initdb (i.e. added in the for loops 3 and 16 respectively) and it still
doesn't work :-(
(BW see the error message: 'max_connections (currently 10)' but I set
them to 3 - I think there is an but in the script):

...
selecting default max_connections... 3
selecting default shared_buffers... 16
creating configuration files... ok
creating template1 database in /Users/sschmidt/PgSQL/base/1... FATAL:
could not create shared memory segment: Cannot allocate memory
DETAIL: Failed system call was shmget(key=1, size=794624, 03600).
HINT: This error usually means that PostgreSQL's request for a shared
memory segment exceeded available memory or swap space. To reduce the
request size (currently 794624 bytes), reduce PostgreSQL's
shared_buffers parameter (currently 16) and/or its max_connections
parameter
(currently 10).

Hmm, could anyone give my advice on this issue?

Steffen

Responses

Browse pgsql-ports by date

  From Date Subject
Next Message Seum-Lim Gan 2003-11-25 15:47:50 Re: Solaris build of 7.4 problem with
Previous Message Robert Treat 2003-11-25 14:59:20 Re: Solaris build of 7.4 problem with --enable-thread-safety