Aras Angelo wrote:
...
When i kill the earliest idle process the others stop too. So i dont
know whats wrong really. All our apps use the same footer, with
pg_close() at the end....
...
I have done most of the things you guys suggested, so it seems to me
that something between php-apache-postgresql is not doing good, and it
only effects us at peak times, so just wondering if killing processes
every 2-3 minutes, would do harm on our setup....
Are you killing web processes or postgresql processes? If web, you will
probably end up impacting at least some of you users directly. If
PostgreSQL, then you will undoubtedly end up yanking the rug out from
under a process that expected a working database connection. So yes,
you might cause harm. Worse still, you may not solve the problem.
When I hear symptoms like this, especially when they tend to happen
under load, I start looking for a process that is slowing/blocking the
other processes.
Consider a fairly typical PHP script. It might start out opening a
database connection and then do various queries interspersed with
processing. If one process hogs sufficient resources or is holding some
resource or lock that slows or blocks the other PHP processes then you
could easily see numerous idle PG processes. Kill the "offending"
process and the others will often rapidly complete thus releasing their
connections.
If you have enough traffic to justify three webservers then you probably
have enough traffic to deplete your available pg connections in seconds,
not minutes so keep digging.
Cheers,
Steve
--
Sent via pgsql-admin mailing list (pgsql-admin@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin