Re: Big Memory Boxes and pgtune

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, "Warner, Gary, Jr" <gar(at)uab(dot)edu>, postgres performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Big Memory Boxes and pgtune
Date: 2016-11-04 02:24:58
Message-ID: CAOR=d=1qrGT=KiduQn-iw40pagYTAL89_UYBfS4S42Y5T0NJ_A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Wed, Nov 2, 2016 at 5:46 PM, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com> wrote:
> On 10/28/16 2:33 PM, Joshua D. Drake wrote:
>>
>> * A very high shared_buffers (in newer releases, it is not uncommon to
>> have many, many GB of)
>
>
> Keep in mind that you might get very poor results if shared_buffers is
> large, but not large enough to fit the entire database. In that case buffer
> replacement will be *extremely* expensive. Some operations will use a
> different buffer replacement strategy, so you might be OK if some of the
> database doesn't fit in shared buffers; that will depend a lot on your
> access patterns.

This. Especially on machines with fast CPUs / memory and SSDs
underneath, lots of buffers can sometimes just get in the way. The
linux kernel (and most other kernels) has hundreds, even thousands of
man hours put into the file caching code and it's often faster to let
the kernel do that job with the extra memory.

Only a benchmark of a production type load can tell you what to
expect, and only production itself will reveal the absolute truth.
Where I used to work we had 5TB databases on machines with anywhere
from 128GB to 512GB and honesly the extra memory didn't make a huge
difference. They had 8 disk RAID-5 arrays with controller caching
turned off, because it got in the way, and cranking up shared_buffers
didn't not make them faster. I think we settled on something under
10GB on most of them

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Benjamin Toueg 2016-11-04 11:53:49 Re: Perf decreased although server is better
Previous Message Kevin Grittner 2016-11-04 00:05:31 Re: Perf decreased although server is better