Re: Auto-tuning work_mem and maintenance_work_mem - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Auto-tuning work_mem and maintenance_work_mem
Date
Msg-id 20131010224523.GX7092@momjian.us
Whole thread Raw
In response to Re: Auto-tuning work_mem and maintenance_work_mem  (Josh Berkus <josh@agliodbs.com>)
List pgsql-hackers
On Thu, Oct 10, 2013 at 03:40:17PM -0700, Josh Berkus wrote:
> 
> >> I don't follow that.  Why would using a connection pooler change the multiples
> >> of work_mem that a connection would use?
> > 
> > I assume that a connection pooler would keep processes running longer,
> > so even if they were not all using work_mem, they would have that memory
> > mapped into the process, and perhaps swapped out.
> 
> Yes, and then this is when it *really* matters what OS you're running,
> and what release.  FreeBSD and Solaris++ don't overallocate RAM, so
> those long-running connections pin a lot of RAM eventually.  And for
> Linux, it's a question of how aggressive the OOM killer is, which kinda
> depends on distro/version/sysadmin settings.
> 
> When I configure pgbouncer for Illumos users, I specifically have it
> rotate out old connections once an hour for this reason.

Just as a point of education, this is a good idea why you want to
allocate swap even if you expect your workload to fit in memory. 
Pushing unused memory to swap is a good use of swap.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + Everyone has their own god. +



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Auto-tuning work_mem and maintenance_work_mem
Next
From: Jim Nasby
Date:
Subject: Re: ENABLE/DISABLE CONSTRAINT NAME