mardi 29 décembre 2009

postgresql macosx shared memory error

When running my postgresql server on my Snow Leopard MacosX I have an error :

FATAL: could not create shared memory segment: Invalid argument
DETAIL: Failed system call was shmget(key=5432001, size=16400384, 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 16400384 bytes), reduce PostgreSQL's shared_buffers parameter (currently 1536) and/or its max_connections parameter (currently 103).
If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case raising the request size or reconfiguring SHMMIN is called for.
The PostgreSQL documentation contains more information about shared memory configuration.


You must change the settings for the shared memory segment :

Run time fix :
sudo sysctl -w kern.sysv.shmall=65536
sudo sysctl -w kern.sysv.shmmax=16777216

This will not resolve the problem after a reboot, to fix this add in /etc/sysctl.conf this two lines :

kern.sysv.shmall=65536
kern.sysv.shmmax=16777216


You must create this file if it doesn't already exist

Aucun commentaire: