[pgpool-committers: 8802] pgpool: Replace exclusive locking with shared locking in query cache.
Tatsuo Ishii
ishii at sraoss.co.jp
Mon Sep 19 14:48:18 JST 2022
Replace exclusive locking with shared locking in query cache.
Previously the query cache module used semaphore to protect critical
region in the query cache module. However this had serious down side
because the locking using semaphore is exclusive lock. This
introduces unnecessary wait for cache reading clients and performance
degradation when there are many concurrent clients.
To overcome the issue replace locking implementation with flock(2)
which allows share locking. Now the cache reading clients do not need
to fight each other to obtain a lock thus this increases
concurrency.
For this purpose pgpool main process creates a dummy file as
"logdir/memq_lock_file" and opens it. The file descriptor is inherited
by all child process so that they can issue flock(2) on the file.
Discussion: https://www.pgpool.net/pipermail/pgpool-general/2022-September/008442.html
Discussion: https://www.pgpool.net/pipermail/pgpool-hackers/2022-September/004196.html
Branch
------
master
Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=dc559c07ee5affc7035efa6e0f00185e211079a0
Modified Files
--------------
src/include/query_cache/pool_memqcache.h | 16 +++++++++++++--
src/main/pgpool_main.c | 26 ++++++++++++++++++++++++
src/query_cache/pool_memqcache.c | 34 +++++++++++++++++++++++---------
src/utils/pool_process_reporting.c | 2 +-
src/utils/pool_relcache.c | 4 ++--
5 files changed, 68 insertions(+), 14 deletions(-)
More information about the pgpool-committers
mailing list