Thread: Re: could not create shared memory segment: Invalid argument

Re: could not create shared memory segment: Invalid argument

From
Ryan King - NOAA Affiliate
Date:
Apologies ahead of time for not knowing which group to send to, but I wanted to see if anyone has encountered and resolved this type of error. I'm setting up postgresql 9.2 streaming replication on RH and after copying the master data directory over to the slave, the psql service refuses start and gives the following errors. 



   2015-07-13 23:55:41.224 UTC FATAL:  could not create shared memory segment: Invalid argument
   2015-07-13 23:55:41.224 UTC DETAIL:  Failed system call was shmget(key=5432001, size=1146945536, 03600).
   2015-07-13 23:55:41.224 UTC 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 1146945536 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers or max_connections.
        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.
   2015-07-13 23:56:21.344 UTC FATAL:  could not create shared memory segment: Invalid argument
   2015-07-13 23:56:21.344 UTC DETAIL:  Failed system call was shmget(key=5432001, size=58302464, 03600).
   2015-07-13 23:56:21.344 UTC 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 58302464 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers or max_connections.
        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.



I've set shared_buffer way down to next to nothing along with kernel.shmmax and kernel.shmall per some blogs. However, the same error persists, and I'm getting no where. I think ultimately the solution is to upgrade, but the devs may not be ready for an upgrade at this point. Any help would be greatly appreciated. Thanks!

Re: could not create shared memory segment: Invalid argument

From
Scott Ribe
Date:
On Jul 13, 2015, at 6:08 PM, Ryan King - NOAA Affiliate <ryan.king@noaa.gov> wrote:
>
> I've set shared_buffer way down to next to nothing...

Yet pg is still trying for 1GB at startup. You should make sure that the postgresql.conf you've been editing is the one
that'sactually being used. (And, BTW, admin is the right list for this discussion.) 

--
Scott Ribe
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
https://www.linkedin.com/in/scottribe/
(303) 722-0567 voice