Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 43DA064FCF3 for ; Wed, 27 Aug 2008 19:29:06 -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 94834-06 for ; Wed, 27 Aug 2008 19:28:55 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.232]) by postgresql.org (Postfix) with ESMTP id 2AA5864FCDA for ; Wed, 27 Aug 2008 19:28:58 -0300 (ADT) Received: by rv-out-0506.google.com with SMTP id b25so101747rvf.43 for ; Wed, 27 Aug 2008 15:28:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=PqpgF7rzHqvHu9Cv7zGWwcL9eQj1d4ZJd1n02tqzF+8=; b=Q9fq3DXzfDbkG98xgZe9orfWnjZkhk+lhXaOgl9zsWkP9A1DmSCDKk20EmTU8ZIv7b lgIly5AfqbIbmo/8KsxHImL7uSyIKbvoAckXu8PpR13g4dKS7oGk6pWG+CeKyDwWjd5s MPN+0jnQ+b5SgGyXA/1h9aOEJcSFt0qvLQmVM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=dPWTMwOq7Fh2xPn7kz/HOeRxCRGsNiYWGxhDKyiWZmFLurm9w58ODQNTL1ifS/qJ61 i9QT7oDLiSmKjLoubIasatPZGBVd/eqzXqMJHaBf1X4d6HZP2FY5E55W+bpT4psIefYJ 8yP5HgpoP3zaW1s8YTpD4KXRhm2bEB5U9YFWo= Received: by 10.140.169.4 with SMTP id r4mr322761rve.131.1219876136612; Wed, 27 Aug 2008 15:28:56 -0700 (PDT) Received: by 10.141.197.1 with HTTP; Wed, 27 Aug 2008 15:28:56 -0700 (PDT) Message-ID: Date: Wed, 27 Aug 2008 16:28:56 -0600 From: "Scott Marlowe" To: david@lang.hm Subject: Re: select on 22 GB table causes "An I/O error occured while sending to the backend." exception Cc: "Andrew Sullivan" , pgsql-performance@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <82bpze3ou8.fsf@mid.bfk.de> <20080827221338.GP18946@commandprompt.com> 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/359 X-Sequence-Number: 31240 On Wed, Aug 27, 2008 at 4:22 PM, wrote: > I disagree with you. I think goof Postgres operation is so highly dependant > on caching as much data as possible that disabling overcommit (and throwing > away a lot of memory that could be used for cache) is a solution that's as > bad or worse than the problem it's trying to solve. > > I find that addign a modest amount of swap to the system and leaving > overcommit enabled works better for me, if the system starts swapping I have > a chance of noticing and taking action, but it will ride out small > overloads. but the biggest thing is that it's not that much more acceptable > for me to have other programs on the box failing due to memory allocation > errors, and those will be much more common with overcommit disabled then the > OOM killer would be with it enabled I don't generally find this to be the case because I usually allocate about 20-25% of memory to shared_buffers, use another 10-20% for work_mem across all backends, and let the OS cache with the other 50-60% or so of memory. In this situation allocations rarely, if ever, fail. Note I also turn swappiness to 0 or 1 or something small too. Otherwise linux winds up swapping out seldom used shared_buffers to make more kernel cache, which is counter productive in the extreme.