[pgpool-general: 647] Pgpool PHP PDO connection not closing after script execution

Aleksej Trofimov aleksej.trofimov at ruptela.lt
Tue Jun 19 22:02:13 JST 2012


Hello,
     Several days ago I faced with a pgpool (3.1.3) + php 
pdo(5.3.9-1.ius.el5) problem. My project has a lot of connection per 
second (about 40 in a second), so we are using pgpool in load balancer 
and master/slave mode. Not a long time ago we decided to rewrite our php 
code to support PDO, but after all test went good we faced with a 
problem, when pgpool reaches connection maximum in a several seconds 
with a 90% of idle connections. We have such a configuration:

num_init_children = 100
max_pool = 2
child_life_time = 300
child_max_connections = 20
connection_life_time = 20
client_idle_limit = 20

Without a PDO extension, everything works great, we have 40-45 pgpool 
processes running on a server at an average. After we enabling PDO in 
our code, pgpool process starting to grow very fast until 
num_init_children and 90 of them are with idle status. The problem does 
not exist without pgpool in a midle (if we connect to database directly, 
we are using postgresql 9.1).

  We also tried to increase num_init_children but no effect, maximum is 
reached in a several seconds..

Our php script uses  such a logic:
$this->_connection = new PDO();

Using $this->_connection

$this->_connection = NULL;

And we are not using persistence mode..

May be someone know the solution?




-- 
Best regards

Aleksej Trofimov




More information about the pgpool-general mailing list