pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feedRe: {Spam} Will shared_buffers crash a server
2+ messages / 2 participants
[nested] [flat]
* Re: {Spam} Will shared_buffers crash a server
@ 2011-04-29 10:37 French, Martin <frenchm@cromwell.co.uk>
2011-05-01 16:18 ` Re: {Spam} Will shared_buffers crash a server Marti Raudsepp <marti@juffo.org>
0 siblings, 1 reply; 2+ messages in thread
From: French, Martin @ 2011-04-29 10:37 UTC (permalink / raw)
To: Qiang Wang <forest_qiang@yahoo.com>; pgsql-performance
What messages did you get in the Postgresql logs?
What other parameters have changed?
From: pgsql-performance-owner@postgresql.org
[mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Qiang Wang
Sent: 29 April 2011 08:13
To: pgsql-performance@postgresql.org
Subject: {Spam} [PERFORM] Will shared_buffers crash a server
Hei:
We have PostgreSQL 8.3 running on Debian Linux server. We built an
applicantion using PHP programming language and Postgres database. There
are appoximatly 150 users using the software constantly. We had some
performance degration before and after some studies we figured out we
will need to tune PostgreSQL configurations.
We have 10GB memory and we tuned PostgreSQL as follow:
- max_connection = 100
- effective_cache_size = 5GB
- shared_buffer = 2GB
- wal_buffer = 30MB
- work_mem = 50MB
However we suffered 2 times server crashes after tunning the
configuration. Does anyone have any idea how this can happen?
BR
Kevin Wang
___________________________________________________
This email is intended for the named recipient. The information contained
in it is confidential. You should not copy it for any purposes, nor
disclose its contents to any other party. If you received this email
in error, please notify the sender immediately via email, and delete it from
your computer.
Any views or opinions presented are solely those of the author and do not
necessarily represent those of the company.
PCI Compliancy: Please note, we do not send or wish to receive banking, credit
or debit card information by email or any other form of communication.
Please try our new on-line ordering system at http://www.cromwell.co.uk/ice
Cromwell Tools Limited, PO Box 14, 65 Chartwell Drive
Wigston, Leicester LE18 1AT. Tel 0116 2888000
Registered in England and Wales, Reg No 00986161
VAT GB 115 5713 87 900
__________________________________________________
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: {Spam} Will shared_buffers crash a server
2011-04-29 10:37 Re: {Spam} Will shared_buffers crash a server French, Martin <frenchm@cromwell.co.uk>
@ 2011-05-01 16:18 ` Marti Raudsepp <marti@juffo.org>
0 siblings, 0 replies; 2+ messages in thread
From: Marti Raudsepp @ 2011-05-01 16:18 UTC (permalink / raw)
To: Qiang Wang <forest_qiang@yahoo.com>; +Cc: French, Martin <frenchm@cromwell.co.uk>; pgsql-performance
Qiang Wang <forest_qiang@yahoo.com> wrote:
> We have PostgreSQL 8.3 running on Debian Linux server. We built an
> applicantion using PHP programming language and Postgres database. There are
> appoximatly 150 users using the software constantly. We had some performance
> degration before and after some studies we figured out we will need to tune
> PostgreSQL configurations.
> However we suffered 2 times server crashes after tunning the configuration.
> Does anyone have any idea how this can happen?
Could you explain in more detail, *how* it crashed?
On Linux, the first suspect for crashes is usually the OOM
(out-of-memory) killer. When the kernel thinks it's run out of memory,
it picks a task and kills it. Due to the way PostgreSQL uses shared
memory, it's more likely to be killed than other processes.
To figure out whether you've suffered an OOM kill, run "dmesg", you
would see something like:
[2961426.424851] postgres invoked oom-killer: gfp_mask=0x201da,
order=0, oomkilladj=0
[2961426.424857] postgres cpuset=/ mems_allowed=0
[2961426.424861] Pid: 932, comm: postgres Not tainted 2.6.31-22-server
#65-Ubuntu
[2961426.424863] Call Trace:
...
The first step in solving OOM kills is disabling memory overcommit;
add 'vm.overcommit_memory = 0' to /etc/sysctl.conf and run the command
'echo 0 > /proc/sys/vm/overcommit_memory'
This doesn't prevent OOM kills entirely, but usually reduces them
significantly, queries will now abort with an "out of memory" error if
they're responsible for memory exhaustion.
You can also reduce the chance that PostgreSQL is chosen for killing,
by changing its oom_adj, documented here:
http://blog.credativ.com/en/2010/03/postgresql-and-linux-memory-management.html
Regards,
Marti
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2011-05-01 16:18 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-04-29 10:37 Re: {Spam} Will shared_buffers crash a server French, Martin <frenchm@cromwell.co.uk>
2011-05-01 16:18 ` Marti Raudsepp <marti@juffo.org>
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