pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: could not create shared memory segment: Invalid argument
10+ messages / 4 participants
[nested] [flat]

* Re: could not create shared memory segment: Invalid argument
@ 2015-07-14 00:08  Ryan King - NOAA Affiliate <ryan.king@noaa.gov>
  0 siblings, 2 replies; 10+ messages in thread

From: Ryan King - NOAA Affiliate @ 2015-07-14 00:08 UTC (permalink / raw)
  To: pgsql-general@postgresql.org; pgsql-admin@postgresql.org; pgsql-performance

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!

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: could not create shared memory segment: Invalid argument
@ 2015-07-14 00:15  Scott Whitney <scott@journyx.com>
  0 siblings, 1 reply; 10+ messages in thread

From: Scott Whitney @ 2015-07-14 00:15 UTC (permalink / raw)
  To: Ryan King - NOAA Affiliate <ryan.king@noaa.gov>; pgsql-general@postgresql.org <pgsql-general@postgresql.org>; pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>; pgsql-performance

What is your kernel SHMMAX? Usually somewhere under /etc/sysconfig. Depends on your distro. This is telling you that your kernel does not have sufficient resources.

-------- Original message --------
From: Ryan King - NOAA Affiliate <ryan.king@noaa.gov>
Date: 07/13/2015 7:10 PM (GMT-06:00)
To: pgsql-general@postgresql.org, pgsql-admin@postgresql.org, pgsql-performance@postgresql.org
Subject: Re: [ADMIN] could not create shared memory segment: Invalid argument

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!


Journyx, Inc.
7600 Burnet Road #300
Austin, TX 78757
www.journyx.com

p 512.834.8888
f 512-834-8858

Do you receive our promotional emails? You can subscribe or unsubscribe to those emails at http://go.journyx.com/emailPreference/e/4932/714/


^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: could not create shared memory segment: Invalid argument
@ 2015-07-14 00:16  Scott Ribe <scott_ribe@elevated-dev.com>
  parent: Ryan King - NOAA Affiliate <ryan.king@noaa.gov>
  1 sibling, 0 replies; 10+ messages in thread

From: Scott Ribe @ 2015-07-14 00:16 UTC (permalink / raw)
  To: Ryan King - NOAA Affiliate <ryan.king@noaa.gov>; +Cc: pgsql-admin <pgsql-admin@postgresql.org>

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's actually 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







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



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: could not create shared memory segment: Invalid argument
@ 2015-07-14 00:26  Ryan King - NOAA Affiliate <ryan.king@noaa.gov>
  parent: Scott Whitney <scott@journyx.com>
  0 siblings, 1 reply; 10+ messages in thread

From: Ryan King - NOAA Affiliate @ 2015-07-14 00:26 UTC (permalink / raw)
  To: Scott Whitney <scott@journyx.com>; +Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>

Hi Scott. Removing the other groups and only copying admin.

Here are the current settings - I know very low, but I just kept going
downwards until there was no where else to go:


# Controls the maximum shared segment size, in bytes
#kernel.shmmax = 68719476736 - orginal
#kernel.shmmax = 16833540096
kernel.shmmax = 168

# Controls the maximum number of shared memory segments, in pages
#kernel.shmall = 4294967296  - orginal
kernel.shmall = 4109751

Thanks


Ryan King

Internet Dissemination Group, Kansas City

Shared Infrastructure Services Branch

National Weather Service

Contractor / Insight Global <https://www.insightglobal.net/; / Ace Info
Solutions, Inc. <http://www.aceinfosolutions.com/;

On Mon, Jul 13, 2015 at 7:15 PM, Scott Whitney <scott@journyx.com> wrote:

>  What is your kernel SHMMAX? Usually somewhere under /etc/sysconfig.
> Depends on your distro. This is telling you that your kernel does not have
> sufficient resources.
>
> -------- Original message --------
> From: Ryan King - NOAA Affiliate <ryan.king@noaa.gov>
> Date: 07/13/2015 7:10 PM (GMT-06:00)
> To: pgsql-general@postgresql.org, pgsql-admin@postgresql.org,
> pgsql-performance@postgresql.org
> Subject: Re: [ADMIN] could not create shared memory segment: Invalid
> argument
>
>       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!
>
>
>  Journyx, Inc.
> 7600 Burnet Road #300
> Austin, TX 78757
> www.journyx.com
>
>  p 512.834.8888
> f 512-834-8858
>
>  Do you receive our promotional emails? You can subscribe or unsubscribe
> to those emails at http://go.journyx.com/emailPreference/e/4932/714/
>

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: could not create shared memory segment: Invalid argument
@ 2015-07-14 00:43  Scott Ribe <scott_ribe@elevated-dev.com>
  parent: Ryan King - NOAA Affiliate <ryan.king@noaa.gov>
  0 siblings, 1 reply; 10+ messages in thread

From: Scott Ribe @ 2015-07-14 00:43 UTC (permalink / raw)
  To: Ryan King - NOAA Affiliate <ryan.king@noaa.gov>; +Cc: Scott Whitney <scott@journyx.com>; pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>

On Jul 13, 2015, at 6:26 PM, Ryan King - NOAA Affiliate <ryan.king@noaa.gov> wrote:
> 
> # Controls the maximum shared segment size, in bytes
> #kernel.shmmax = 68719476736 - orginal
> #kernel.shmmax = 16833540096
> kernel.shmmax = 168
> 
> # Controls the maximum number of shared memory segments, in pages
> #kernel.shmall = 4294967296  - orginal
> kernel.shmall = 4109751

Wait, you need to be going *UP* on these. They need to be >= postgres's shared buffers + some minor other stuff.

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







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



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: could not create shared memory segment: Invalid argument
@ 2015-07-14 00:49  Ryan King - NOAA Affiliate <ryan.king@noaa.gov>
  parent: Scott Ribe <scott_ribe@elevated-dev.com>
  0 siblings, 1 reply; 10+ messages in thread

From: Ryan King - NOAA Affiliate @ 2015-07-14 00:49 UTC (permalink / raw)
  To: Scott Ribe <scott_ribe@elevated-dev.com>; +Cc: Scott Whitney <scott@journyx.com>; pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>

Yeah thanks I see I was going the wrong way...thanks.
So shared_buffers is 15gb and max_conn = 1000.

However, after increasing, same issue.

# Controls the maximum shared segment size, in bytes
#kernel.shmmax = 68719476736
kernel.shmmax = 268719476736

# Controls the maximum number of shared memory segments, in pages
#kernel.shmall = 4294967296
kernel.shmall = 4294967296

This should be plenty...

On Mon, Jul 13, 2015 at 7:43 PM, Scott Ribe <scott_ribe@elevated-dev.com>
wrote:

> On Jul 13, 2015, at 6:26 PM, Ryan King - NOAA Affiliate <
> ryan.king@noaa.gov> wrote:
> >
> > # Controls the maximum shared segment size, in bytes
> > #kernel.shmmax = 68719476736 - orginal
> > #kernel.shmmax = 16833540096
> > kernel.shmmax = 168
> >
> > # Controls the maximum number of shared memory segments, in pages
> > #kernel.shmall = 4294967296  - orginal
> > kernel.shmall = 4109751
>
> Wait, you need to be going *UP* on these. They need to be >= postgres's
> shared buffers + some minor other stuff.
>
> --
> Scott Ribe
> scott_ribe@elevated-dev.com
> http://www.elevated-dev.com/
> https://www.linkedin.com/in/scottribe/
> (303) 722-0567 voice
>
>
>
>
>
>

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: could not create shared memory segment: Invalid argument
@ 2015-07-14 01:15  Scott Ribe <scott_ribe@elevated-dev.com>
  parent: Ryan King - NOAA Affiliate <ryan.king@noaa.gov>
  0 siblings, 0 replies; 10+ messages in thread

From: Scott Ribe @ 2015-07-14 01:15 UTC (permalink / raw)
  To: Ryan King - NOAA Affiliate <ryan.king@noaa.gov>; +Cc: Scott Whitney <scott@journyx.com>; pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>

On Jul 13, 2015, at 6:49 PM, Ryan King - NOAA Affiliate <ryan.king@noaa.gov> wrote:
> 
> Yeah thanks I see I was going the wrong way...thanks. 
> So shared_buffers is 15gb and max_conn = 1000. 

OK, you haven't shared your OS or hardware setup, but a few general points:

- 15GB is large for PG shared buffers; it usually doesn't help to go that high; remember, shared buffers is a kind of working cache, not the whole cache, PG depends on the OS caching of recently-used files;

- Your shmall is only 16GB. PG may not be the only user of shared memory. It doesn't make sense to have shmall * page size < shmmax.

- Also, does your platform have some absolute upper limit on shmmax? 250GB seems awfully high...

- With 1,000 clients, you'd likely benefit from connection pooling; after you get things up, you should consider pgbouncer.

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







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



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: could not create shared memory segment: Invalid argument
@ 2015-07-14 13:59  Andy Colson <andy@squeakycode.net>
  parent: Ryan King - NOAA Affiliate <ryan.king@noaa.gov>
  1 sibling, 1 reply; 10+ messages in thread

From: Andy Colson @ 2015-07-14 13:59 UTC (permalink / raw)
  To: Ryan King - NOAA Affiliate <ryan.king@noaa.gov>; pgsql-general@postgresql.org

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



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



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: could not create shared memory segment: Invalid argument
@ 2015-07-15 14:13  Ryan King - NOAA Affiliate <ryan.king@noaa.gov>
  parent: Andy Colson <andy@squeakycode.net>
  0 siblings, 1 reply; 10+ messages in thread

From: Ryan King - NOAA Affiliate @ 2015-07-15 14:13 UTC (permalink / raw)
  To: Andy Colson <andy@squeakycode.net>; +Cc: pgsql-general@postgresql.org

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.

On Tue, Jul 14, 2015 at 8:59 AM, Andy Colson <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
>
>

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: could not create shared memory segment: Invalid argument
@ 2015-07-16 20:22  Andy Colson <andy@squeakycode.net>
  parent: Ryan King - NOAA Affiliate <ryan.king@noaa.gov>
  0 siblings, 0 replies; 10+ messages in thread

From: Andy Colson @ 2015-07-16 20:22 UTC (permalink / raw)
  To: Ryan King - NOAA Affiliate <ryan.king@noaa.gov>; +Cc: pgsql-general@postgresql.org

> 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



^ permalink  raw  reply  [nested|flat] 10+ messages in thread


end of thread, other threads:[~2015-07-16 20:22 UTC | newest]

Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-07-14 00:08 Re: could not create shared memory segment: Invalid argument Ryan King - NOAA Affiliate <ryan.king@noaa.gov>
2015-07-14 00:16 ` Scott Ribe <scott_ribe@elevated-dev.com>
2015-07-14 13:59 ` Andy Colson <andy@squeakycode.net>
2015-07-15 14:13   ` Ryan King - NOAA Affiliate <ryan.king@noaa.gov>
2015-07-16 20:22     ` Andy Colson <andy@squeakycode.net>
2015-07-14 00:15 Re: could not create shared memory segment: Invalid argument Scott Whitney <scott@journyx.com>
2015-07-14 00:26 ` Ryan King - NOAA Affiliate <ryan.king@noaa.gov>
2015-07-14 00:43   ` Scott Ribe <scott_ribe@elevated-dev.com>
2015-07-14 00:49     ` Ryan King - NOAA Affiliate <ryan.king@noaa.gov>
2015-07-14 01:15       ` Scott Ribe <scott_ribe@elevated-dev.com>

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