Re: Clients disconnect but query still runs

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Csaba Nagy <nagy(at)ecircle-ag(dot)com>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, Jasen Betts <jasen(at)xnet(dot)co(dot)nz>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Clients disconnect but query still runs
Date: 2009-07-30 11:44:13
Message-ID: 4A71878D.6070606@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Csaba Nagy wrote:

> It happened to us when a client box went out of memory and started
> swapping up to the point it was unaccessible even for console login. The
> connections of that machine were still live but unusable, as the client
> box will never get out of that state until hard resetting... which we
> would promptly do

You know, you can prevent that on any sane operating system by setting
resource limits on any at-risk processes, limiting total available swap
to a reasonable amount, etc. On Linux you may want to turn off memory
overcommit or dramatically reduce how much swap you allocate.

A host with a runaway process hogging memory shouldn't be dying. It
should really be killing off the problem process, or the problem process
should be dying its self after failing to allocate requested memory. If
this isn't the case, YOU HAVE TOO MUCH SWAP.

After all, swap is useless if there's so much that using it brings the
system to a halt.

> I will probably have to check out now the network connection
> parameters in the postgres configuration, never had a look at them
> before... in any case >2 hours mentioned in an earlier post seems a bad
> default to me.

It's the OS's default. PostgreSQL just doesn't change it.

--
Craig Ringer

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Csaba Nagy 2009-07-30 11:46:34 Re: Clients disconnect but query still runs
Previous Message Alban Hertroys 2009-07-30 11:43:51 Re: org.postgresql.util.PSQLException: PANIC: could not write to log file 6