Re: Current best practice for maximum shared_buffers settings on big hardware?

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Current best practice for maximum shared_buffers settings on big hardware?
Date: 2017-05-24 15:58:55
Message-ID: 20170524155855.GH31097@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, May 24, 2017 at 08:24:15AM -0400, Bill Moran wrote:
> ... I tried allocating 64G to shared buffers and we had a bunch of problems
> with inconsistent performance, including "stall" periods where the database
> would stop responding for 2 or 3 seconds. After trying all sorts of tuning
> options that didn't help, the problem finally went away after reducing
> shared_buffers to 32G. I speculated, at the time, that the shared buffer code
> hit performance issues managing that much memory, but I never had the
> opportunity to really follow up on it.

I think you were hitting an issue related to "kernel shared memory" and maybe
"transparent huge pages".

I was able to work around similar issues with ~32GB allocations to QEMU/QEMU
running on something like kernel 3.13. I didn't spend time to narrow down the
problem, and I don't know if the behavior is better with recent kernel.

/sys/kernel/mm/ksm/run=2
... and maybe also:
/sys/kernel/mm/transparent_hugepage/defrag=madvise
/sys/kernel/mm/ksm/merge_across_nodes=0

Justin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Paquier 2017-05-24 16:02:14 Re: Is there possibility btree_redo with XLOG_BTREE_DELETE done between standby_redo and the end of backup
Previous Message stevenchang1213 2017-05-24 15:53:32 Re: Current best practice for maximum shared_buffers settings on big hardware?