October 20th, 2003, 01:50 PM
postgres maxing out on connections
When I run pg_close on a resource id , it does not seem to shut down properly(not at all). If I refresh a page rapidly, eventually, the page will stop working, due to too many connections.
if I do a 'ps' i see a long list of idle postgres processes spawned by apached.
Any thoughts on where to look?
I've tried persistent connections and non-persistant, same thing.
Also tried PEAR with the same result.
I close all connections with either PEAR or pg_close($rid);
If you need more details, just let me know.
October 20th, 2003, 02:11 PM
Googled around a little bit and found something that might suggest a solution.
If httpd.conf has a MaxClients set to a greater number than the maximum number of connections allowed in postgresql.conf, this could cause the problem.
Seems like there is a timeout somewhere before these connections shut down.
October 24th, 2003, 10:10 AM
Hmm... this doesn't sound quite right. Are you seeing anything unusual in the PostgreSQL or Apache logs?. It might be that you have some poorly tuned queries that are "running away" with the process. I made a mistake in a query once that resulted in PostgreSQL churning for hours, so of course every PHP page using that query would start another interminable process .
Have you tried comparing the number of running apache processes to the number of postgres processes?