Discussion:
Idle processes won't die
(too old to reply)
James Taylor
2004-02-24 22:50:44 UTC
Permalink
Hi everyone, using mod_perl with Postgres, postgres is on the same
server as the webserver. Perl is opening connections, and then closing
them at the end of every script, however Pg
is refusing to close the connection, and I have tons and tons of Idle
processes sitting around, which causes the web site to crash because
the maximum number of pgsql processes gets reached after the site is
accessed 32 times. From everything I know about Perl, even if I didn't
implicitly close the database handles, the perl garbage handler would
close them for me. Is there some sort of configuration for postgres to
disallow all these idle processes from sticking around, so they
maybe... close themselves after 5 seconds or something similar?


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ***@postgresql.org
Tom Lane
2004-02-24 23:56:55 UTC
Permalink
Post by James Taylor
Hi everyone, using mod_perl with Postgres, postgres is on the same
server as the webserver. Perl is opening connections, and then closing
them at the end of every script, however Pg
is refusing to close the connection,
In that case, Perl is *not* closing the connection. Better check your
client library again ... it probably thinks it's supposed to recycle
the connections via a connection pool.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match
Rajesh Kumar Mallah
2004-02-25 01:30:14 UTC
Permalink
Dear James,

We have been using mod_perl with PostgreSQL in web environment
without any problems. I hope you are already using Apache::DBI for
connection pooling.

Regds
Mallah
Post by James Taylor
Hi everyone, using mod_perl with Postgres, postgres is on the same
server as the webserver. Perl is opening connections, and then
closing them at the end of every script, however Pg
is refusing to close the connection, and I have tons and tons of Idle
processes sitting around, which causes the web site to crash because
the maximum number of pgsql processes gets reached after the site is
accessed 32 times. From everything I know about Perl, even if I
didn't implicitly close the database handles, the perl garbage handler
would close them for me. Is there some sort of configuration for
postgres to disallow all these idle processes from sticking around, so
they maybe... close themselves after 5 seconds or something similar?
---------------------------(end of broadcast)---------------------------
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Loading...