postgresql, pg_pconnect issues, how to close connection properly
am 08.09.2006 20:50:43 von Julian Tree
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?
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: postgresql, pg_pconnect issues, how to close connection properly
am 08.09.2006 21:19:15 von Ferencz-Csibi Attila
2006/9/8, Julian Tree :
> 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.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php