Re: Thoughts about NUM_BUFFER_PARTITIONS

From: wenhui qiu <qiuwenhuifx(at)gmail(dot)com>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Thoughts about NUM_BUFFER_PARTITIONS
Date: 2024-02-08 13:27:36
Message-ID: CAGjGUAKeTV2SUmWO90dqZgQjpqYUEMOL1==1fDVFc=+6ZJ8hhQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Heikki Linnakangas
I think the larger shared buffer higher the probability of multiple
backend processes accessing the same bucket slot BufMappingLock
simultaneously, ( InitBufTable(NBuffers + NUM_BUFFER_PARTITIONS); When I
have free time, I want to do this test. I have seen some tests, but the
result report is in Chinese

Best wishes

Heikki Linnakangas <hlinnaka(at)iki(dot)fi> 于2024年2月8日周四 19:26写道:

> On 08/02/2024 12:17, wenhui qiu wrote:
> > HI hackers
> > When I read this text in this document there is a paragraph in
> > it(https://www.interdb.jp/pg/pgsql08/03.html
> > <https://www.interdb.jp/pg/pgsql08/03.html>)
> > /*
> > The BufMappingLock is split into partitions to reduce contention in the
> > buffer table (the default is 128 partitions). Each BufMappingLock
> > partition guards a portion of the corresponding hash bucket slots.
> > */,
> >
> > Physical servers with terabytes of RAM are now commonplace,I'm looking
> > at the comments inside the source code.I'm looking at the comments
> > inside the source code to see if they still match the current hardware
> > capability?
>
> The optimal number of partitions has more to do with the number of
> concurrent processes using the buffer cache, rather than the size of the
> cache. The number of CPUs in servers has increased too, but not as much
> as RAM.
>
> But yeah, it's a valid question if the settings still make sense with
> modern hardware.
>
> > The comment says that in the future there may be a
> > parameter,Iam a dba now and I try to think of implementing this
> > parameter, but I'm not a professional kernel developer, I still want the
> > community senior developer to implement this parameter
>
> The first thing to do would be to benchmark with different
> NUM_BUFFER_PARTITIONS settings, and see if there's benefit in having
> more partitions.
>
> --
> Heikki Linnakangas
> Neon (https://neon.tech)
>
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message James Coleman 2024-02-08 13:53:10 Re: Question about behavior of deletes with REPLICA IDENTITY NOTHING
Previous Message Mats Kindahl 2024-02-08 13:16:11 Re: glibc qsort() vulnerability