pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedPostgres shared memory error
4+ messages / 2 participants
[nested] [flat]
* Postgres shared memory error
@ 2012-04-28 16:10 Kevin Kempter <cs_dba@consistentstate.com>
0 siblings, 1 reply; 4+ messages in thread
From: Kevin Kempter @ 2012-04-28 16:10 UTC (permalink / raw)
To: pgsql-admin
All;
I just want to be sure that I'm not causing myself greif. I have a kvm
in the cloud that is supposed to have access to 32GB of ram. when I do a
top I only see 1GB of ram, I've pinged the hosting provider, maybe it
shows up as it's used?
Anyway when I try and start postgres I see this:
/
$ 2012-04-28 12:00:33 EDT [6429]: [1-1] FATAL: XX000: could not
create shared memory segment: Cannot allocate memory
2012-04-28 12:00:33 EDT [6429]: [2-1] DETAIL: Failed system call was
shmget(key=5432001, size=7700914176, 03600).
2012-04-28 12:00:33 EDT [6429]: [3-1] HINT: This error usually means
that PostgreSQL's request for a shared memory segment exceeded available
memory or swap space. To reduce the request size (currently 7700914176
bytes), reduce PostgreSQL's shared_buffers parameter (currently 917504)
and/or its max_connections parameter (currently 503).
The PostgreSQL documentation contains more information about
shared memory configuration.
2012-04-28 12:00:33 EDT [6429]: [4-1] LOCATION:
InternalIpcMemoryCreate, pg_shmem.c:178 /
Which means I should bump up shmmax like this:
/# sysctl -w kernel.shmmax=7700914176/
and add it to /etc/sysctl.conf:
/# tail /etc/sysctl.conf
kernel.msgmax = 65536
# Controls the maximum shared segment size, in bytes
kernel.shmmax = 68719476736
# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296
#PostgreSQL
kernel.shmmax = 7700914176 /
I assume I should have to tweak ONLY kernel.shmmax, am I correct?
I'm also assuming that this is a KVM cloud host provider issue, i.e. it
looks like I actually do not have 32G or ram. Does anyone disagree with
my conclusions?
Thanks in advance
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Postgres shared memory error
@ 2012-04-28 16:32 Fernando Hevia <fhevia@gmail.com>
parent: Kevin Kempter <cs_dba@consistentstate.com>
0 siblings, 1 reply; 4+ messages in thread
From: Fernando Hevia @ 2012-04-28 16:32 UTC (permalink / raw)
To: Kevin Kempter <cs_dba@consistentstate.com>; +Cc: pgsql-admin
On Sat, Apr 28, 2012 at 13:10, Kevin Kempter <cs_dba@consistentstate.com>wrote:
> All;
>
> I just want to be sure that I'm not causing myself greif. I have a kvm in
> the cloud that is supposed to have access to 32GB of ram. when I do a top I
> only see 1GB of ram, I've pinged the hosting provider, maybe it shows up as
> it's used?
>
>
What does the 'free' command show?
> Anyway when I try and start postgres I see this:
> *
> $ 2012-04-28 12:00:33 EDT [6429]: [1-1] FATAL: XX000: could not create
> shared memory segment: Cannot allocate memory
> 2012-04-28 12:00:33 EDT [6429]: [2-1] DETAIL: Failed system call was
> shmget(key=5432001, size=7700914176,
> 03600).
> 2012-04-28 12:00:33 EDT [6429]: [3-1] HINT: This error usually means that
> PostgreSQL's request for a shared memory segment exceeded available memory
> or swap space. To reduce the request size (currently 7700914176 bytes),
> reduce PostgreSQL's shared_buffers parameter (currently 917504) and/or its
> max_connections parameter (currently
> 503).
> The PostgreSQL documentation contains more information about
> shared memory
> configuration.
>
> 2012-04-28 12:00:33 EDT [6429]: [4-1] LOCATION: InternalIpcMemoryCreate,
> pg_shmem.c:178 *
>
>
> Which means I should bump up shmmax like this:
>
> *# sysctl -w kernel.shmmax=7700914176*
>
>
> and add it to /etc/sysctl.conf:
>
> *# tail
> /etc/sysctl.conf
> kernel.msgmax =
> 65536
>
>
>
> # Controls the maximum shared segment size, in
> bytes
> kernel.shmmax =
> 68719476736
>
>
>
> # Controls the maximum number of shared memory segments, in
> pages
> kernel.shmall =
> 4294967296
>
>
>
> #PostgreSQL
>
> kernel.shmmax = 7700914176 *
>
>
> I assume I should have to tweak ONLY kernel.shmmax, am I correct?
>
Correct.
> I'm also assuming that this is a KVM cloud host provider issue, i.e. it
> looks like I actually do not have 32G or ram. Does anyone disagree with my
> conclusions?
>
>
You haven't provided evidence on how much RAM your system sees. A free -m
will show the total memory the system has and is being used.
Regards.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Postgres shared memory error
@ 2012-04-28 16:37 Kevin Kempter <cs_dba@consistentstate.com>
parent: Fernando Hevia <fhevia@gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Kevin Kempter @ 2012-04-28 16:37 UTC (permalink / raw)
To: Fernando Hevia <fhevia@gmail.com>; +Cc: pgsql-admin
On 04/28/2012 10:32 AM, Fernando Hevia wrote:
>
>
> On Sat, Apr 28, 2012 at 13:10, Kevin Kempter
> <cs_dba@consistentstate.com <mailto:cs_dba@consistentstate.com>> wrote:
>
> All;
>
> I just want to be sure that I'm not causing myself greif. I have
> a kvm in the cloud that is supposed to have access to 32GB of ram.
> when I do a top I only see 1GB of ram, I've pinged the hosting
> provider, maybe it shows up as it's used?
>
>
> What does the 'free' command show?
>
> Anyway when I try and start postgres I see this:
> /
> $ 2012-04-28 12:00:33 EDT [6429]: [1-1] FATAL: XX000: could not
> create shared memory segment: Cannot allocate memory
> 2012-04-28 12:00:33 EDT [6429]: [2-1] DETAIL: Failed system call
> was shmget(key=5432001, size=7700914176, 03600).
> 2012-04-28 12:00:33 EDT [6429]: [3-1] HINT: This error usually
> means that PostgreSQL's request for a shared memory segment
> exceeded available memory or swap space. To reduce the request
> size (currently 7700914176 bytes), reduce PostgreSQL's
> shared_buffers parameter (currently 917504) and/or its
> max_connections parameter (currently 503).
> The PostgreSQL documentation contains more information
> about shared memory configuration.
> 2012-04-28 12:00:33 EDT [6429]: [4-1] LOCATION:
> InternalIpcMemoryCreate, pg_shmem.c:178 /
>
>
> Which means I should bump up shmmax like this:
>
> /# sysctl -w kernel.shmmax=7700914176/
>
>
> and add it to /etc/sysctl.conf:
>
> /# tail /etc/sysctl.conf
> kernel.msgmax = 65536
>
> # Controls the maximum shared segment size, in bytes
> kernel.shmmax = 68719476736
>
> # Controls the maximum number of shared memory segments, in pages
> kernel.shmall = 4294967296
>
> #PostgreSQL
> kernel.shmmax = 7700914176 /
>
>
> I assume I should have to tweak ONLY kernel.shmmax, am I correct?
>
>
> Correct.
>
> I'm also assuming that this is a KVM cloud host provider issue,
> i.e. it looks like I actually do not have 32G or ram. Does anyone
> disagree with my conclusions?
>
>
> You haven't provided evidence on how much RAM your system sees. A free
> -m will show the total memory the system has and is being used.
> Regards.
Free command:
/ # free
total used free shared buffers cached
Mem: 1020856 946804 74052 0 61280 796004
-/+ buffers/cache: 89520 931336
Swap: 0 0 0/
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Postgres shared memory error
@ 2012-04-29 00:13 Fernando Hevia <fhevia@gmail.com>
parent: Kevin Kempter <cs_dba@consistentstate.com>
0 siblings, 0 replies; 4+ messages in thread
From: Fernando Hevia @ 2012-04-29 00:13 UTC (permalink / raw)
To: Kevin Kempter <cs_dba@consistentstate.com>; +Cc: pgsql-admin
On Sat, Apr 28, 2012 at 13:37, Kevin Kempter <cs_dba@consistentstate.com>wrote:
>
> Free command:
>
> * # free
> total used free shared buffers cached
> Mem: 1020856 946804 74052 0 61280 796004
> -/+ buffers/cache: 89520 931336
> Swap: 0 0 0*
>
>
>
You are right. Your system has only 1 GB RAM.
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2012-04-29 00:13 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-04-28 16:10 Postgres shared memory error Kevin Kempter <cs_dba@consistentstate.com>
2012-04-28 16:32 ` Fernando Hevia <fhevia@gmail.com>
2012-04-28 16:37 ` Kevin Kempter <cs_dba@consistentstate.com>
2012-04-29 00:13 ` Fernando Hevia <fhevia@gmail.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