Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 8CB6864FFE8 for ; Thu, 28 Aug 2008 13:51:01 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 39970-01-10 for ; Thu, 28 Aug 2008 13:50:56 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from bifrost.lang.hm (mail.lang.hm [64.81.33.126]) by postgresql.org (Postfix) with ESMTP id 1C6BB650258 for ; Thu, 28 Aug 2008 13:50:48 -0300 (ADT) Received: from asgard.lang.hm (asgard.lang.hm [10.0.0.100]) by bifrost.lang.hm (8.13.4/8.13.4/Debian-3) with ESMTP id m7SGog4c016890; Thu, 28 Aug 2008 09:50:42 -0700 Date: Thu, 28 Aug 2008 09:51:09 -0700 (PDT) From: david@lang.hm X-X-Sender: dlang@asgard.lang.hm To: Matthew Wakeling cc: pgsql-performance@postgresql.org Subject: Re: select on 22 GB table causes "An I/O error occured while sending to the backend." exception In-Reply-To: Message-ID: References: <82bpze3ou8.fsf@mid.bfk.de> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200808/377 X-Sequence-Number: 31258 On Thu, 28 Aug 2008, Matthew Wakeling wrote: > On Wed, 27 Aug 2008, david@lang.hm wrote: >> if memory overcommit is disabled, the kernel checks to see if you have an >> extra 1G of ram available, if you do it allows the process to continue, if >> you don't it tries to free memory (by throwing away cache, swapping to >> disk, etc), and if it can't free the memory will return a memroy allocation >> error (which I believe will cause firefox to exit). > > Remember that the memory overcommit check is checking against the amount of > RAM + swap you have - not just the amount of RAM. When a fork occurs, hardly > any extra actual RAM is used (due to copy on write), but the potential is > there for the process to use it. If overcommit is switched off, then you just > need to make sure there is *plenty* of swap to convince the kernel that it > can actually fulfil all of the memory requests if all the processes behave > badly and all shared pages become unshared. Then the consequences of > processes actually using that memory are that the machine will swap, rather > than the OOM killer having to act. if you are correct that it just checks against memory+swap then it's not a big deal, but I don't think it does that. I think it actually allocates the memory, and if it does that it will push things out of ram to do the allocation, I don't believe that it will allocate swap space directly. David Lang > Of course, it's generally bad to run a machine with more going on than will > fit in RAM. > > Neither swapping nor OOM killing are particularly good - it's just a > consequence of the amount of memory needed being unpredictable. > > Probably the best solution is to just tell the kernel somehow to never kill > the postmaster. > > Matthew > >