Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Dilip Kumar <dilipbalaut@gmail.com>
Cc: tender wang <tndrwang@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-01-31T23:31:34Z
Lists: pgsql-hackers
Attachments
On 2024-Jan-29, Dilip Kumar wrote: > Thank you for working on this. There is one thing that I feel is > problematic. We have kept the allowed values for these GUCs to be in > multiple of SLRU_BANK_SIZE i.e. 16 and that's the reason the min > values were changed to 16 but in this refactoring patch for some of > the buffers you have changed that to 8 so I think that's not good. Oh, absolutely, you're right. Restored the minimum to 16. So, here's the patchset as two pieces. 0001 converts SlruSharedData->latest_page_number to use atomics. I don't see any reason to mix this in with the rest of the patch, and though it likely won't have any performance advantage by itself (since the lock acquisition is pretty much the same), it seems better to get it in ahead of the rest -- I think that simplifies matters for the second patch, which is large enough. So, 0002 introduces the rest of the feature. I removed use of banklocks in a different amount as banks, and I made commit_ts use a longer lwlock acquisition at truncation time, rather than forcing all-lwlock acquisition. The more I look at 0002, the more I notice that some comments need badly updated, so please don't read too much into it yet. But I wanted to post it anyway for archives and cfbot purposes. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
Commits
-
Fix zeroing of pg_serial page without SLRU bank lock
- be2f07310063 17.0 landed
-
Fix misspelled assertions
- 0d3a71d0c8a7 17.0 landed
-
GUC table: Add description to computed variables
- 30b8d6e4ce11 17.0 landed
-
Improve performance of subsystems on top of SLRU
- 53c2a97a9266 17.0 landed
-
Rename SLRU elements in view pg_stat_slru
- bcdfa5f2e2f2 17.0 landed
-
Use atomic access for SlruShared->latest_page_number
- d172b717c6f4 17.0 landed
-
Split use of SerialSLRULock, creating SerialControlLock
- 7b745d85b80d 17.0 landed
-
Index SLRUs by 64-bit integers rather than by 32-bit integers
- 4ed8f0913bfd 17.0 cited
-
Add a macro templatized hashtable.
- b30d3ea824c5 10.0 cited