I just upgraded from 6-STABLE as of 2006-02-18 to 6-STABLE as of 2006-05-21, and was surprised to find that PostgreSQL wouldn't start because it couldn't allocate enough shared memory. Thing is, I didn't make a single hardware change during the reboot and didn't upgrade any ports on the machine. My emergency fix was to edit postgresql.conf to change shared_buffers from 8192 to 2048. Unfortunately, that seems to be hurting performance - I'm getting annoying deadlocks at 4AM whenever multiple daemons start their overnight batch runs. Has anyone else seen this behavior when upgrading from 6.0 to 6.1? Any ideas for a fix? I apologize for not having a logfiles, but I was pretty much in a panic to get it back up and running ASAP and didn't think about it until it was too late. -- Kirk Strauser
On May 23, 2006, at 1:31 PM, Kirk Strauser wrote:> I just upgraded from 6-STABLE as of 2006-02-18 to 6-STABLE as of > 2006-05-21, > and was surprised to find that PostgreSQL wouldn't start because it > couldn't allocate enough shared memory. Thing is, I didn't make a > single > hardware change during the reboot and didn't upgrade any ports on the > machine. > > My emergency fix was to edit postgresql.conf to change > shared_buffers from > 8192 to 2048. Unfortunately, that seems to be hurting performance > - I'm > getting annoying deadlocks at 4AM whenever multiple daemons start > their > overnight batch runs. > > Has anyone else seen this behavior when upgrading from 6.0 to 6.1? > Any > ideas for a fix? > > I apologize for not having a logfiles, but I was pretty much in a > panic to > get it back up and running ASAP and didn't think about it until it > was too > late. > -- > Kirk StrauserYou need to adjust the shared memory segments allowed by the kernel; see /usr/ports/databases/postgresql<your-version>-server/pkg-message- server for what to add to your kernel config. Most likely, you forgot to move over your kernel customizations to your new kernel...? -Marshall
On May 23, 2006, at 4:31 PM, Kirk Strauser wrote:> Has anyone else seen this behavior when upgrading from 6.0 to 6.1? > Any > ideas for a fix? >no. not seen it. did you have a custom kernel with higher SHM settings on 6.0? In any case, here is what you do: in /etc/sysctl.conf add these: kern.ipc.shm_use_phys=1 kern.ipc.shmmax=1073741824 kern.ipc.shmall=262144 kern.ipc.semmsl=512 kern.ipc.semmap=256 and in /boot/loader.conf add these: kern.ipc.semmni=32 kern.ipc.semmns=512 the "sem" variables are really only needed if you want a lot of connections, say > 100. The "shm" settings will cover you for tens of thousands of shared buffers in postgres. You can obviously tune those down to your taste.