public inbox for [email protected]
help / color / mirror / Atom feedFrom: Andrey M. Borodin <[email protected]>
To: Dilip Kumar <[email protected]>
Cc: Alvaro Herrera <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock
Date: Sat, 4 Nov 2023 23:07:52 +0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAFiTN-s=xkyWV+RDhMfxwz49xEFMQncTDP=scCJiWvh_ZfsxbA@mail.gmail.com>
References: <CAFiTN-taYmir2_g+aWeEVQopvLB5K-0316KAFsBEsXx5OiaM9A@mail.gmail.com>
<[email protected]>
<CAFiTN-sC+FP3qbtAFZ+NxF=fSw+EJKQZHe5hUCG8S+7FMBUOVA@mail.gmail.com>
<CAFiTN-s=xkyWV+RDhMfxwz49xEFMQncTDP=scCJiWvh_ZfsxbA@mail.gmail.com>
> On 30 Oct 2023, at 09:20, Dilip Kumar <[email protected]> wrote:
>
> changed the logic of SlruAdjustNSlots() in 0002, such that now it
> starts with the next power of 2 value of the configured slots and
> keeps doubling the number of banks until we reach the number of banks
> to the max SLRU_MAX_BANKS(128) and bank size is bigger than
> SLRU_MIN_BANK_SIZE (8). By doing so, we will ensure we don't have too
> many banks
There was nothing wrong with having too many banks. Until bank-wise locks and counters were added in later patchsets.
Having hashtable to find SLRU page in the buffer IMV is too slow. Some comments on this approach can be found here [0].
I'm OK with having HTAB for that if we are sure performance does not degrade significantly, but I really doubt this is the case.
I even think SLRU buffers used HTAB in some ancient times, but I could not find commit when it was changed to linear search.
Maybe we could decouple locks and counters from SLRU banks? Banks were meant to be small to exploit performance of local linear search. Lock partitions have to be bigger for sure.
> On 30 Oct 2023, at 09:20, Dilip Kumar <[email protected]> wrote:
>
> I have taken 0001 and 0002 from [1], done some bug fixes in 0001
BTW can you please describe in more detail what kind of bugs?
Thanks for working on this!
Best regards, Andrey Borodin.
[0] https://www.postgresql.org/message-id/flat/CA%2BhUKGKVqrxOp82zER1%3DXN%3DyPwV_-OCGAg%3Dez%3D1iz9rG%2...
view thread (9+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox