Status: Rejected in upstream (kern/77353) postgresql documentation encourages to grow SysV IPC limits on *BSD systems (which obviously applies to GNU/k*BSD ones too): The options SYSVSHM and SYSVSEM need to be enabled when the kernel is compiled. (They are by default.) The maximum size of shared memory is determined by the option SHMMAXPGS (in pages). The following shows an example of how to set the various parameters: options SYSVSHM options SHMMAXPGS=4096 options SHMSEG=256 options SYSVSEM options SEMMNI=256 options SEMMNS=512 options SEMMNU=256 options SEMMAP=256 (On NetBSD and OpenBSD the key word is actually option singular.) You might also want to configure your kernel to lock shared memory into RAM and prevent it from being paged out to swap. Use the sysctl setting kern.ipc.shm_use_phys. --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -55,6 +55,11 @@ options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores +options SHMMAXPGS=4096 +options SHMSEG=256 +options SEMMNI=256 +options SEMMNS=512 +options SEMMNU=256 options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options KBD_INSTALL_CDEV # install a CDEV entry in /dev --- a/sys/i386/conf/GENERIC +++ b/sys/i386/conf/GENERIC @@ -56,6 +56,11 @@ options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores +options SHMMAXPGS=4096 +options SHMSEG=256 +options SEMMNI=256 +options SEMMNS=512 +options SEMMNU=256 options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options KBD_INSTALL_CDEV # install a CDEV entry in /dev