Hi folks,
I have the following in a delete method for an application I have
$queue = $config->queue->get('rebuildProxyDb');
$queue = new Zend_Queue('Db', $queue->toArray());
$message = array(
'status' => true
);
$message = json_encode($message);
$queue->send($message);
And I find that if I run the above in a loop, the idle connections to
my database rise and rise until ultimately it starts rejecting
connections due to too many being open
postgres=# SELECT count(*) as cnt, usename, current_query FROM
pg_stat_activity GROUP BY usename,current_query ORDER BY cnt DESC;
cnt | usename |
current_query
-----+----------+------------------------------------------------------------------------------------------------------------------------
50 | myuser | <IDLE>
If I remove the queue code, the idle connection problem goes away.
Can anyone provide any insight into what would be causing this? When
the method returns, I would have thought the queue variable would be
cleaned up and the database connections would be all closed.
Thanks in advance,
Tim