Forum OpenACS Q&A: Shared memory block

Collapse
Posted by Rocael Hernández Rizzardini on
Hi all!
I have followed the instructions to run postgres but I got an error:

/usr/local/pgsql/bin/postmaster -B 1000 -o "-S 2000" -S -D
  > /usr/local/pgsql/data

  > and it says:
  > IpcMemoryCreate: shmget failed (Invalid argument) key=5432001,
  > size=8899584,permission=600
  > This type of erro is usually caused by an improper shared memory
or System V
  > IPC semaphore configuration. Form more information....

Im running it on redhat6.2 in a 600Mhz Celeron with 512MB, I really
want to use that configuration.

  Most likely the kernel isn't set to allow shared memory blocks as
  large as 8M. Is this the problem?

if so, how I can set up my kernel to allow shared memory blocks as
large as 8M?

Thank you,

Collapse
Posted by Roberto Mello on
Poul Christiansen replied to this same question that you posted on the pgsql-sql list, so I'll just paste it here so other people can know.
This line will set the maximum shared memory in Linux to 64MB:
echo 67108864 > /proc/sys/kernel/shmmax

You can see your default maximum shared memory with this command:
cat /proc/sys/kernel/shmmax

You should probably set this line in /etc/rd.d/init.d/postgresql or
somewhere else, before PostgreSQL starts because the change will be set
back to the default value when Linux restarts.
Collapse
Posted by Don Baccus on
Just in case someone's running something like RH 5.2 or some other
2.0.* kernel, this only works with 2.2.* and later ones (RH 6.*, for
instance).

If you want to make the change permanent, edit
/usr/include/asm/shmparam.h and build a new kernel...

Collapse
Posted by Rocael Hernández Rizzardini on
It is strange because I run the same command but in other port (-p XXXX) and it is working...
:)