[pgpool-hackers: 3257] Re: [pgpool-committers: 5498] pgpool: Add new 'enable_shared_relcache' parameter.

Takuma Hoshiai hoshiai at sraoss.co.jp
Wed Feb 27 17:21:08 JST 2019


Hi all,

I committed a new feature of shared relation cache on monday.
This feature is that relcache is stored in query cache.

relcache is the result of query executed internally by pgpool to refer to system catalog. 
pgpool store relcache at local cache in order not to execute query many times. 
But It stored at local cache only, so each child process must accessed system catalog using same query.

if enable_shared_relcache added by this feature is on, relcache store at query cache too.
when one child process executed query to refer to system catalog, 
other child processes can use this result from query cache.

This feature enables even if 'memory_cache_enabled' is off.
And basic setting of query cache is used existing parameters, 
but only relcache expiration on query cache use relation_expire.
It means that we can set different expiration on query cache 
both query that executed by user and relcache.

this feature is effective, for example, 
when num_init_children is large, child_max_connections is setting, postgres has many tables, etc.

Best regards,

On Mon, 25 Feb 2019 07:37:35 +0000
Takuma Hoshiai <hoshiai at sraoss.co.jp> wrote:

> Add new 'enable_shared_relcache' parameter.
> 
> The relation cache were stored in local cache of child processes, so all child processes executed same query to get relation cache.
> If enable_shared_relcache is on, the relation cache is stored in memory cache and all child process share it.
> It will expect to reduce the load that same query is executed.
> 
> Branch
> ------
> master
> 
> Details
> -------
> https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=46917d5458a82c75e98b247a74b7ee1827666159
> 
> Modified Files
> --------------
> doc.ja/src/sgml/misc-config.sgml                   |  48 ++++++
> doc/src/sgml/misc-config.sgml                      |  29 ++++
> src/config/pool_config_variables.c                 |  10 ++
> src/include/pool_config.h                          |   3 +-
> src/include/query_cache/pool_memqcache.h           |   7 +-
> src/main/pgpool_main.c                             |   4 +-
> src/protocol/child.c                               |   5 +-
> src/protocol/pool_process_query.c                  |   3 +-
> src/query_cache/pool_memqcache.c                   | 151 +++++++++++++++--
> src/sample/pgpool.conf.sample                      |   5 +
> src/sample/pgpool.conf.sample-logical              |   5 +
> src/sample/pgpool.conf.sample-master-slave         |   5 +
> src/sample/pgpool.conf.sample-replication          |   5 +
> src/sample/pgpool.conf.sample-stream               |   5 +
> .../tests/025.enable_shared_relcache/test.sh       |  69 ++++++++
> src/utils/pool_process_reporting.c                 |   7 +-
> src/utils/pool_relcache.c                          | 186 ++++++++++++++++++++-
> 17 files changed, 516 insertions(+), 31 deletions(-)
> 


-- 
Takuma Hoshiai <hoshiai at sraoss.co.jp>



More information about the pgpool-hackers mailing list