pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
killing old connections
3+ messages / 3 participants
[nested] [flat]

* killing old connections
@ 2000-06-06 15:33 Tim White <twhite@friendlyworks.com>
  2000-06-07 15:19 ` Re: killing old connections Joshua Leshan <leshan@ugsolutions.com>
  2000-06-08 15:05 ` Re: killing old connections Reiner Dassing <dassing@wettzell.ifag.de>
  0 siblings, 2 replies; 3+ messages in thread

From: Tim White @ 2000-06-06 15:33 UTC (permalink / raw)
  To: pgsql-admin

Is there a way to view the active/inactive connections to PostgreSQL 6.5.3?
And if so is it possible to kill those that are inactive?  I'm having
difficulty in testing using a Java application, where connections are
established and then not being destroyed properly.  This causes me to get an
error message stating that there are "...too many clients already.".

Any help is greatly appreciated.

Tim White




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: killing old connections
  2000-06-06 15:33 killing old connections Tim White <twhite@friendlyworks.com>
@ 2000-06-07 15:19 ` Joshua Leshan <leshan@ugsolutions.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Joshua Leshan @ 2000-06-07 15:19 UTC (permalink / raw)
  To: Tim White <twhite@friendlyworks.com>; +Cc: pgsql-admin

Did you get an answer to this?

If you are on a unix machine you can check the processes (using ps)
 and then grep for pgsql or the postgres user.

Once you have that list, you can kill the individual processes (if you have
the proper permissions).

Jd

On Tue, 6 Jun 2000, Tim White wrote:

> Is there a way to view the active/inactive connections to PostgreSQL 6.5.3?
> And if so is it possible to kill those that are inactive?  I'm having
> difficulty in testing using a Java application, where connections are
> established and then not being destroyed properly.  This causes me to get an
> error message stating that there are "...too many clients already.".
> 
> Any help is greatly appreciated.
> 
> Tim White
> 




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: killing old connections
  2000-06-06 15:33 killing old connections Tim White <twhite@friendlyworks.com>
@ 2000-06-08 15:05 ` Reiner Dassing <dassing@wettzell.ifag.de>
  1 sibling, 0 replies; 3+ messages in thread

From: Reiner Dassing @ 2000-06-08 15:05 UTC (permalink / raw)
  To: Tim White <twhite@friendlyworks.com>; +Cc: pgsql-admin

Hello Tim!


Tim White wrote:
> 
> Is there a way to view the active/inactive connections to PostgreSQL 6.5.3?

I have the same problems, but I solved it by using the following
algorithm:

1. Get a list all processes of the postmaster by
   ps -u postgres | grep /usr/local/pgsql/bin/postmaster

2. If there is just 1 process, finish

3. Determine the pid's (Process IDs) of all the processes of step 1

4. Determine the PPIDs (Parent PIDs) of all processes, by
   ps -p PID -o ppid    
   (well, this line is for Tru64; you have to ask your man page for your
switches)

5. Determine the process which is the father of all your processes,
   this is the one which has as its father the PID 1

   The father postmaster so to say is not the process you should look at
   during the further steps.

6. For all the other PIDs do
   - determine the elapsed sleeping time and ist state
     by    ps -p PID -o etime,sl,state (under Tru64)
   - if the sleeping time is greater than ??? hours (or minutes)
     kill it by 'kill PID'

This algorithm was implemented in PERL and is running every hour
via cron.

Maybe that helps    

> And if so is it possible to kill those that are inactive?  I'm having
> difficulty in testing using a Java application, where connections are
> established and then not being destroyed properly.  This causes me to get an
> error message stating that there are "...too many clients already.".
> 
> Any help is greatly appreciated.
> 
> Tim White

--
Mit freundlichen Gruessen / With best regards
   Reiner Dassing



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2000-06-08 15:05 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-06-06 15:33 killing old connections Tim White <twhite@friendlyworks.com>
2000-06-07 15:19 ` Joshua Leshan <leshan@ugsolutions.com>
2000-06-08 15:05 ` Reiner Dassing <dassing@wettzell.ifag.de>

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