Re: IpcMemoryCreate: shmget failed (Invalid argument)

From: James Thornton <james(at)unifiedmind(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: IpcMemoryCreate: shmget failed (Invalid argument)
Date: 2001-04-28 20:14:52
Message-ID: 3AEB24BC.52639E7E@unifiedmind.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

James Thornton wrote:

> I get this error when trying to start postgres with a block size > the
> default of 64...
>
> [postgres(at)roam pgsql]$ /usr/local/pgsql/bin/postmaster -B 2000 -D
> /usr/local/pgsql/data
> IpcMemoryCreate: shmget failed (Invalid argument) key=5432001,
> size=33652736, permission=600
> This type of error is usually caused by an improper
> shared memory or System V IPC semaphore configuration.
> For more information, see the FAQ and platform-specific
> FAQ's in the source directory pgsql/doc or on our
> web site at http://www.postgresql.org.
> FATAL 1: ShmemCreate: cannot create region
>
> I am running PG 7.03, and I assume that you'll want to need to know my
> OS...
>
> [postgres(at)roam pgsql]$ uname -a
> Linux roam 2.2.14-5.0 #1 Tue Mar 7 21:07:39 EST 2000 i686 unknown
>
> (RedHat 6.2)

I found the solution at http://www.ca.postgresql.org/devel-corner/docs/postgres/kernel-resources.html#SYSVIPC-PARAMETERS

In a nutshell...

(regarding GNU/Linux)

The default shared memory limit (both SHMMAX and SHMALL) is 32 MB in 2.2 kernels, but it can be changed in the proc file system (without reboot). For example, to allow 128
MB:

$ echo 134217728 >/proc/sys/kernel/shmall
$ echo 134217728 >/proc/sys/kernel/shmmax

NOTE: 134217728 = 128 * 1024 * 1024

You could put these commands into a script run at boot-time.

Alternatively, you can use sysctl, if available, to control these parameters. Look for a file called /etc/sysctl.conf and add lines like the following to it:

kernel.shmall = 134217728
kernel.shmmax = 134217728

This file is usually processed at boot time, but sysctl can also be called explicitly later.

Other parameters are sufficiently sized for any application. If you want to see for yourself look into /usr/src/linux/include/asm-xxx/shmparam.h and
/usr/src/linux/include/linux/sem.h.

- JT
________________________________________
James Thornton, http://jamesthornton.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message webb sprague 2001-04-28 20:33:48 Re: Vacuum analyze keeps hanging (RedHat 6.2, PG 7.03)
Previous Message Ashley Clark 2001-04-28 20:14:21 Re: SQL Where Like - Range it?!