Re: postgresql, pg_pconnect issues, how to close connection properly

From: Date: Fri, 08 Sep 2006 19:19:15 +0000
Subject: Re: postgresql, pg_pconnect issues, how to close connection properly
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-42333@lists.php.net to get a copy of this message
2006/9/8, Julian Tree <julian.tree@gmail.com>:
I have a pretty complex data base that runs a lot of aggreated function (sum, count in addtion to joins) constantly. If I turn off pg_pconnect, the connection takes too long, if I turn on the pg_pconnect, the connection eventually max out. My current solution is to have cron job to restart apache gracefull every minute. apachectl graceful I don't like this solution. Is there a way to reset the connections every so often?
Hi You're running out off memory? Read after about optimization of postgresql server settings But probably that won't be enough. You should realy look after those queries too. Why are they takeing so much of resources? I bet that you can optimize them. Expand your hardware (maybe some more memory will do the job?) You can optimize your code. As a workaround you can use 2 different connections. One for the complex sql queries and one for relative
simple ones. Monitoring the load distribution    should also help.
So you realy, realy have the job to do :) A.

« previous php.db (#42333) next »