From: Stephen J Lombardo <LombardoS@Mail.Montclair.edu>
To: pgsql-sql@postgreSQL.org <pgsql-sql@postgreSQL.org>
Subject: Re: [SQL] zombie postmasters
Date: Tue, 16 Nov 1999 18:39:27 -0500
Message-ID: <3831EB2F.9BD737CD@mail.montclair.edu> (raw)
References: <000201bf3087$3afadae0$810a0a0a@hamid.emarq>
Hamid Khoshnevis wrote:
> In a web environment, a user can repeatedly starts and abort large queries
> which create a large number of zombie postmasters. Is there a way to
> control the postmaster zombies so that they don't clog up the system
> resources.
I am assuming that by "web environment" you are speaking of utilizing a
PostgreSQL
database via a CGI, Servlet, etc... If this is the case it is usually easiest
to make sure that your
program gracefully handles a client disconnect by cleanly disconnecting from
the database. This
usually involves a little more code, and strict error checking on the part of
your web application,
but it will reduce headaches in the long run.
Depending on the programming environment you are using you may be able to
employ a
technique such as connection pooling/handling to seperate the actual database
access from the program
handling IO. This way even if the client disconnects in the middle of a large
query the
connection manager can still cleanly disconnect from the database or clean up
from the offending statement..
Utilizing a connection handler offers other benefits as well; namely it can
eliminate the need to open
a new database connection for every CGI process or Servlet thread. This can
reduce overhead by
making it unneccesary for Postgres to start a new process for yet another
client, and hence authenticating
another user.
~Stephen
==
Stephen J Lombardo
Web/Database Application Developer
Montclair State University
==
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: LombardoS@Mail.Montclair.edu
Subject: Re: [SQL] zombie postmasters
In-Reply-To: <3831EB2F.9BD737CD@mail.montclair.edu>
References: <000201bf3087$3afadae0$810a0a0a@hamid.emarq> <3831EB2F.9BD737CD@mail.montclair.edu>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox