[pgpool-general: 9014] Re: exemption of "postgres" default database from connection caching

Nathan Mehl n+pgpool at oden.io
Wed Feb 7 01:18:03 JST 2024


Following up on this:

We have been testing the following patch in our pre-production environment:

diff --git a/src/protocol/child.c b/src/protocol/child.c
index d334dad3c..77a4337e9 100644
--- a/src/protocol/child.c
+++ b/src/protocol/child.c
@@ -562,7 +562,6 @@ backend_cleanup(POOL_CONNECTION * volatile *frontend,
POOL_CONNECTION_POOL * vol
  if ((sp &&
  (!strcmp(sp->database, "template0") ||
   !strcmp(sp->database, "template1") ||
-  !strcmp(sp->database, "postgres") ||
   !strcmp(sp->database, "regression"))) ||
  (*frontend != NULL &&
  ((*frontend)->socket_state == POOL_SOCKET_EOF ||

The primary effect seems to be a small increase in the average number of
open connections to our primary db instance.

I would like to suggest that the list of databases to exempt from
connection caching should be a configurable value; if there is interest I
could try to work up a patch/PR.  Alternatively the above-patch as-is would
be fine to apply. :)

-n

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pgpool.net/pipermail/pgpool-general/attachments/20240206/aaee9d74/attachment.htm>


More information about the pgpool-general mailing list