<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body><p>Hi Pgpool team,<br>I have a strange problem with hanging connections in postgresql or I don't know something. On postgres in pg_stat_activity I see many idle connections with "query_start" and "state_change" time from the previous day but they should be closed after 500 seconds (<a href="http://pgpool.conf" target="_blank">pgpool.conf</a> settings).<br>I made a test: create simply python code with loop making connect (using psycopg2), insert and close connection.  <br>Each code call creates a lot of postgres connections and does not close them. I understand that "connection cache" works, but according to pgpool documentation, if the same connection is used, using the same database, username and password should use the existing connection??<br>Did I something misunderstand of connection pooling? <br>Why these old connections in postgresql that are longer than the times specified in <a href="http://pgpool.conf" target="_blank">pgpool.conf</a> not closed ??<br><br>My cluster is : 2 pgpool 4.1 (watchdog) + 2 postgresql 12 (master slave replication)<br><br><a href="http://pgpool.conf" target="_blank">pgpool.conf</a><br># - Concurrent session and pool size -<br><br>num_init_children = 300<br>                                   # Number of concurrent sessions allowed<br>                                   # (change requires restart)<br>max_pool = 5<br>                                   # Number of connection pool caches per connection<br>                                   # (change requires restart)<br># - Life time -<br><br>child_life_time = 600<br>                # Pool exits after being idle for this many seconds<br>child_max_connections = 1510<br>                                   # Pool exits after receiving that many connections<br>                                   # 0 means no exit<br>connection_life_time = 500<br>                                   # Connection to backend closes after being idle for this many seconds<br>                                   # 0 means no close<br>client_idle_limit = 300<br>                                   # Client is disconnected after being idle for that many seconds<br>                                   # (even inside an explicit transactions!)<br>                                   # 0 means no disconnection<br><br>Regards<br>Radoslaw Szczygiel<br><br data-mce-bogus="1"><style type="text/css">#icselection13 {width: 100% !important; height: 100% !important; padding-top: 0px !important; overflow: visible !important;}</style><br><br>--<br>Pozdrawiam <br>Radosław Szczygieł</p></body></html>