Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id BDC0565029F for ; Wed, 27 Aug 2008 23:20:17 -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 15303-02-3 for ; Wed, 27 Aug 2008 23:20:06 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by postgresql.org (Postfix) with ESMTP id D8DAC650295 for ; Wed, 27 Aug 2008 23:20:10 -0300 (ADT) Received: from perhan.alvh.no-ip.org (190-95-19-36.bk17-dsl.surnet.cl [190.95.19.36]) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id m7S2N1MX022732 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 27 Aug 2008 19:23:04 -0700 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id C3D9E47CA7; Wed, 27 Aug 2008 22:19:52 -0400 (CLT) Date: Wed, 27 Aug 2008 22:19:52 -0400 From: Alvaro Herrera To: david@lang.hm Cc: Andrew Sullivan , pgsql-performance@postgresql.org Subject: Re: select on 22 GB table causes "An I/O error occured while sending to the backend." exception Message-ID: <20080828021952.GH4071@alvh.no-ip.org> References: <82bpze3ou8.fsf@mid.bfk.de> <20080827221338.GP18946@commandprompt.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (lists.commandprompt.com [207.173.203.159]); Wed, 27 Aug 2008 19:23:04 -0700 (PDT) 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/360 X-Sequence-Number: 31241 david@lang.hm wrote: > On Wed, 27 Aug 2008, Andrew Sullivan wrote: >>> seperate copies for the seperate processes (and if at this time it runs of >>> of memory it invokes the OOM killer to free some space), >> >> . . .it kills processes that are using a lot of memory. Those are not >> necessarily the processes that are allocating memory they don't need. > > the bahavior of the OOM killer has changed over time, so far nobody has > been able to come up with a 'better' strategy for it to follow. The problem with OOM killer for Postgres is that it tends to kill the postmaster. That's really dangerous. If it simply killed a backend then it wouldn't be so much of a problem. Some time ago I found that it was possible to fiddle with a /proc entry to convince the OOM to not touch the postmaster. A postmaster with the raw IO capability bit set would be skipped by the OOM too killer (this is an Oracle tweak AFAIK). These are tricks that people could use in their init scripts to protect themselves. (I wonder if the initscript supplied by the RPMs or Debian should contain such a hack.) -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support