pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: david@lang.hm
To: Craig James <craig_james@emolecules.com>
Cc: PostgreSQL Performance <pgsql-performance@postgresql.org>
Cc: Matthew Wakeling <matthew@flymine.org>
Subject: Re: select on 22 GB table causes "An I/O error occured while sending to the backend." exception
Date: Thu, 28 Aug 2008 11:27:27 -0700 (PDT)
Message-ID: <alpine.DEB.1.10.0808281118420.2713@asgard.lang.hm> (raw)
In-Reply-To: <48B6EA7E.2090707@emolecules.com>
References: <BAY124-W57D3654AF1159CAF8EAC19F5660@phx.gbl>
	<82bpze3ou8.fsf@mid.bfk.de>
	<alpine.DEB.1.10.0808271436210.907@asgard.lang.hm>
	<alpine.DEB.1.10.0808281411220.4454@aragorn.flymine.org>
	<EADBB336-A14E-492C-A8CA-105C8F77A43A@blighty.com>
	<alpine.DEB.1.10.0808281702450.4454@aragorn.flymine.org>
	<48B6EA7E.2090707@emolecules.com>

On Thu, 28 Aug 2008, Craig James wrote:

> Matthew Wakeling wrote:
>> On Thu, 28 Aug 2008, Steve Atkins wrote:
>>>> Probably the best solution is to just tell the kernel somehow to never 
>>>> kill the postmaster.
>>> 
>>> Or configure adequate swap space?
>> 
>> Oh yes, that's very important. However, that gives the machine the 
>> opportunity to thrash.
>
> No, that's where the whole argument for allowing overcommitted memory falls 
> flat.
>
> The entire argument for allowing overcommitted memory hinges on the fact that 
> processes *won't use the memory*.  If they use it, then overcommitting causes 
> problems everywhere, such as a Postmaster getting arbitrarily killed.
>
> If a process *doesn't* use the memory, then there's no problem with 
> thrashing, right?
>
> So it never makes sense to enable overcommitted memory when Postgres, or any 
> server, is running.
>
> Allocating a big, fat terabyte swap disk is ALWAYS better than allowing 
> overcommitted memory.  If your usage is such that overcommitted memory would 
> never be used, then the swap disk will never be used either.  If your 
> processes do use the memory, then your performance goes into the toilet, and 
> you know it's time to buy more memory or a second server, but in the mean 
> time your server processes at least keep running while you kill the rogue 
> processes.

there was a misunderstanding (for me if nobody else) that without 
overcommit it was actual ram that was getting allocated, which could push 
things out to swap even if the memory ended up not being needed later. 
with the clarification that this is not the case and the allocation is 
just reducing the virtual memory available it's now clear that it is just 
as efficiant to run with overcommit off.

so the conclusion is:

no performance/caching/buffer difference between the two modes.

the differencees between the two are:

with overcommit

   when all ram+swap is used OOM killer is activated.
   for the same amount of ram+swap more allocations can be done before it 
is all used up (how much more is unpredicable)

without overcommit

   when all ram+swap is allocated programs (not nessasarily the memory 
hog) start getting memory allocation errors.


David Lang



view thread (65+ messages)  latest in thread

Message-ID: <alpine.DEB.1.10.0808281118420.2713@asgard.lang.hm>
Permalink:  ../alpine.DEB.1.10.0808281118420.2713@asgard.lang.hm/
Also on:    postgresql.org/message-id/alpine.DEB.1.10.0808281118420.2713@asgard.lang.hm

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: david@lang.hm, craig_james@emolecules.com, matthew@flymine.org
  Subject: Re: select on 22 GB table causes "An I/O error occured while sending to the backend." exception
  In-Reply-To: <alpine.DEB.1.10.0808281118420.2713@asgard.lang.hm>
  References: <BAY124-W57D3654AF1159CAF8EAC19F5660@phx.gbl> <82bpze3ou8.fsf@mid.bfk.de> <alpine.DEB.1.10.0808271436210.907@asgard.lang.hm> <alpine.DEB.1.10.0808281411220.4454@aragorn.flymine.org> <EADBB336-A14E-492C-A8CA-105C8F77A43A@blighty.com> <alpine.DEB.1.10.0808281702450.4454@aragorn.flymine.org> <48B6EA7E.2090707@emolecules.com> <alpine.DEB.1.10.0808281118420.2713@asgard.lang.hm>

* 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