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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2006/9/8, Julian Tree <julian.tree@xxxxxxxxx>:
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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux