Subject: Re: postgre semaphores
To: Jebus <lordjebus@gmail.com>
From: Andy Ruhl <acruhl@gmail.com>
List: port-cobalt
Date: 11/29/2004 17:59:17
On Mon, 29 Nov 2004 15:21:20 -0500, Jebus <lordjebus@gmail.com> wrote:
> I am trying to get postgre installed and this is the error I am
> getting when trying to init the db.
> 
> creating template1 database in /usr/pkg/pgsql/data/base/1...
> IpcSemaphoreCreate: semget(key=4, num=17, 03600) failed: No space left
> on device
> 
> This error does *not* mean that you have run out of disk space.
> 
> It occurs when either the system limit for the maximum number of
> semaphore sets (SEMMNI), or the system wide maximum number of
> semaphores (SEMMNS), would be exceeded.  You need to raise the
> respective kernel parameter.  Alternatively, reduce PostgreSQL's
> consumption of semaphores by reducing its max_connections parameter
> (currently 1).
> 
> I THINK I understand the error but have noo clue how to fix it.

Yeah. SEMMNI and SEMMNS are kernel parameters. Look in the postgres
manual (admin manual I think?) around the area where they say runtime
environment. Those kernel parameters need to be set. Or you can cut
that postgres option in the postgresql.conf file.

Here's what the semaphore related options should look like:

# Standard system options
options         KTRACE          # system call tracing support
options         SYSTRACE        # system call vetting via systrace(1)
options         SYSVMSG         # System V message queues
options         SYSVSEM         # System V semaphores
#options        SEMMNI=10       # number of semaphore identifiers
options         SEMMNI=256      # number of semaphore identifiers
#options        SEMMNS=60       # number of semaphores in system
options         SEMMNS=512      # number of semaphores in system
#options        SEMUME=10       # max number of undo entries per process
options         SEMUME=256      # max number of undo entries per process
#options        SEMMNU=30       # number of undo structures in system
options         SEMMNU=256      # number of undo structures in system
options         SYSVSHM         # System V shared memory
#options        SHMMAXPGS=1024  # 1024 pages is the default
options         SHMMAXPGS=4096  # 1024 pages is the default
options         P1003_1B_SEMAPHORE # p1003.1b semaphore support
#options        LKM             # loadable kernel modules
#options        NTP             # network time protocol
options         USERCONF        # userconf(4) support
#options        PIPE_SOCKETPAIR # smaller, but slower pipe(2)
options         SYSCTL_INCLUDE_DESCR    # Include sysctl descriptions in kernel

# Added by Andy for pgsql tuning
options         SEMMAP=256

Note that I just comment out the default line and then make one that's
the recommended value by postgresql.

Also, I haven't run postgres for a while now since it doesn't run all
that great on the Qube.

Andy