pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andy Colson <andy@squeakycode.net>
To: Ryan King - NOAA Affiliate <ryan.king@noaa.gov>
Cc: pgsql-general@postgresql.org
Subject: Re: could not create shared memory segment: Invalid argument
Date: Thu, 16 Jul 2015 15:22:20 -0500
Message-ID: <55A8127C.6050800@squeakycode.net> (raw)
In-Reply-To: <CAJAJqWE255FD7L2tLVB6GHXH6NfiXjQ9pWZdTXu5DfXuvTdnBA@mail.gmail.com>
References: <CAJAJqWHiAng_dKk7=S3HgiBQuF02PGSxxNS_cBFM0zY36ZqRJA@mail.gmail.com>
	<55A515B4.1080903@squeakycode.net>
	<CAJAJqWE255FD7L2tLVB6GHXH6NfiXjQ9pWZdTXu5DfXuvTdnBA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-general>

> On Tue, Jul 14, 2015 at 8:59 AM, Andy Colson <andy@squeakycode.net
> <mailto:andy@squeakycode.net>> wrote:
>
>     On 7/13/2015 7:08 PM, Ryan King - NOAA Affiliate wrote:
>
>         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!
>
>
>     You don't want to decrease kernel.shmmax you want to set it to the
>     request size:
>
>     sysctl -w kernel.shmmax=1146945536
>
>     shmmax is the only thing you really need to play with.
>
>     -Andy
>
>

On 7/15/2015 9:13 AM, Ryan King - NOAA Affiliate wrote:
 > I tried that too - same result. I updated another box w/ the same issue
 > to 9.4.4, and all is well there. Thanks for your reply.
 >


Ah, I assume then that something else is already using some shared memory.

PG needs:
>  To reduce the request size (currently 58302464 bytes),

That much shared memory *free*.  You can check current usage with:  ipcs -m

Add what PG needs to what you are already using, and you should be good 
to go.

-Andy



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



view thread (10+ messages)

Message-ID: <55A8127C.6050800@squeakycode.net>
Permalink:  ../55A8127C.6050800@squeakycode.net/
Also on:    postgresql.org/message-id/55A8127C.6050800@squeakycode.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: andy@squeakycode.net, ryan.king@noaa.gov, pgsql-general@postgresql.org
  Subject: Re: could not create shared memory segment: Invalid argument
  In-Reply-To: <55A8127C.6050800@squeakycode.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox