effective_cache_size less than shared_buffers

Lists: pgsql-hackers
From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: effective_cache_size less than shared_buffers
Date: 2009-02-25 23:21:20
Message-ID: 49A57E10.EE98.0025.0@wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Should we log a warning at startup when effective_cache_size is less
than shared_buffers?

-Kevin


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size less than shared_buffers
Date: 2009-02-25 23:26:03
Message-ID: 1235604363.24423.40.camel@jd-laptop.pragmaticzealot.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, 2009-02-25 at 17:21 -0600, Kevin Grittner wrote:
> Should we log a warning at startup when effective_cache_size is less
> than shared_buffers?

I would say no. Although I could see an argument for the default
effective_cache_size always being the same size as shared_buffers.

Joshua D. Drake

>
> -Kevin
>
--
PostgreSQL - XMPP: jdrake(at)jabber(dot)postgresql(dot)org
Consulting, Development, Support, Training
503-667-4564 - http://www.commandprompt.com/
The PostgreSQL Company, serving since 1997


From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size less than shared_buffers
Date: 2009-02-26 01:04:07
Message-ID: 49A5EA87.2080901@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Joshua D. Drake wrote:
> On Wed, 2009-02-25 at 17:21 -0600, Kevin Grittner wrote:
>> Should we log a warning at startup when effective_cache_size is less
>> than shared_buffers?
>
> I would say no. Although I could see an argument for the default
> effective_cache_size always being the same size as shared_buffers.

That's certainly not what we've meant historically by ECS. Generally
it's been the size of shared_buffers *and* the FS cache. If it were
just the size of shared_buffers, then we wouldn't need a 2nd setting,
would we?

--Josh


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size less than shared_buffers
Date: 2009-02-26 01:33:20
Message-ID: 1235612000.24423.44.camel@jd-laptop.pragmaticzealot.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, 2009-02-25 at 17:04 -0800, Josh Berkus wrote:
> Joshua D. Drake wrote:
> > On Wed, 2009-02-25 at 17:21 -0600, Kevin Grittner wrote:
> >> Should we log a warning at startup when effective_cache_size is less
> >> than shared_buffers?
> >
> > I would say no. Although I could see an argument for the default
> > effective_cache_size always being the same size as shared_buffers.
>
> That's certainly not what we've meant historically by ECS. Generally
> it's been the size of shared_buffers *and* the FS cache. If it were
> just the size of shared_buffers, then we wouldn't need a 2nd setting,
> would we?

We can't determine the size of the FS cache. We can determine the size
of the shared_buffers. The idea here is to eliminate one of those by
default PostgreSQL is slow issues. Since we are already using X amount
of shared_buffers we know we have at least X amount of cache.

Sincerely,

Joshua D. Drake

>
> --Josh
>
>
--
PostgreSQL - XMPP: jdrake(at)jabber(dot)postgresql(dot)org
Consulting, Development, Support, Training
503-667-4564 - http://www.commandprompt.com/
The PostgreSQL Company, serving since 1997


From: Greg Stark <stark(at)enterprisedb(dot)com>
To: jd(at)commandprompt(dot)com
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size less than shared_buffers
Date: 2009-02-26 08:27:40
Message-ID: 4136ffa0902260027l202e2df9xe55591ba8d9eecc8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Feb 26, 2009 at 1:33 AM, Joshua D. Drake <jd(at)commandprompt(dot)com> wrote:
>
> On Wed, 2009-02-25 at 17:04 -0800, Josh Berkus wrote:
>
>> Joshua D. Drake wrote:
>>
>> > I would say no. Although I could see an argument for the default
>> > effective_cache_size always being the same size as shared_buffers.
>>
>> That's certainly not what we've meant historically by ECS.

> Since we are already using X amount
> of shared_buffers we know we have at least X amount of cache.

That's not what you wrote, at least how it was understood. It sounds
like you're in violent agreement.

> We can't determine the size of the FS cache.

Hence why we have the parameter.

> We can determine the size
> of the shared_buffers. The idea here is to eliminate one of those by
> default PostgreSQL is slow issues.

Well we won't eliminate any problems unless we actually override the
effective_cache_size setting by clipping it to shared_buffers. I don't
really see much of a problem doing that. The only case where that
would annoy someone was if they're intentionally understating
effective_cache_size to push the planner into avoiding nested loops
and I doin't think it's a powerful enough knob to be very likely used
that way.

--
greg


From: Harald Armin Massa <chef(at)ghum(dot)de>
To: Greg Stark <stark(at)enterprisedb(dot)com>
Cc: jd(at)commandprompt(dot)com, Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size less than shared_buffers
Date: 2009-02-26 09:14:55
Message-ID: e3e180dc0902260114q2a350dbax5aa65fd3345e694b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Greg,

>
> Well we won't eliminate any problems unless we actually override the
> effective_cache_size setting by clipping it to shared_buffers. I don't
> really see much of a problem doing that. The only case where that
> would annoy someone was if they're intentionally understating
> effective_cache_size to push the planner into avoiding nested loops
> and I doin't think it's a powerful enough knob to be very likely used
> that way.
>

My experience from PostgreSQL on Windows: effective_cache_size should
reflect the value of "system cache" from task manager. shared_buffers (on
windows) should be rather small.

My real-workload-tests (no benchmarks, real usage of DB-Server) showed that
big shared buffers on Windows have a negative effect on PostgreSQL
performance. I have found no explanation WHY it is this way.

Harald

--
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Spielberger Straße 49
70435 Stuttgart
0173/9409607
no fx, no carrier pigeon
-
EuroPython 2009 will take place in Birmingham - Stay tuned!