Re: Backends dying due to memory exhaustion--I'm stonkered - Mailing list pgsql-general

From Tom Lane
Subject Re: Backends dying due to memory exhaustion--I'm stonkered
Date
Msg-id 17482.980566745@sss.pgh.pa.us
Whole thread Raw
In response to Re: Backends dying due to memory exhaustion--I'm stonkered  (Doug McNaught <doug@wireboard.com>)
List pgsql-general
Doug McNaught <doug@wireboard.com> writes:
> From what I've seen so far, all the backends (other than the one that
> actually crashes) seem to survive the SIGTERM I send to the
> postmaster.  How do I tell which one is which?  The command line?

SIGTERM to the postmaster commands polite shutdown, ie, don't accept
new connections but allow existing clients to finish out their sessions.
So unless your clients are short-lived I wouldn't expect SIGTERM'ing
the postmaster to do much.

If you want to force things to happen then you should send SIGINT to
the postmaster, which in turn will SIGTERM its backends, which in
theory will abort their transactions and shut down.  (No, this isn't
real consistent, but we wanted the right things to happen when a
system-wide shutdown sends SIGTERM to all the processes.  Usually
you shouldn't be manually killing individual backends anyway, so the
lack of consistency in signal meaning shouldn't mean much...)

As far as telling which is which, I doubt it much matters for this.
If you've compiled with -g then the backtraces should show the queries
that each one was executing, and that's as much info as we're likely
to need.

            regards, tom lane

pgsql-general by date:

Previous
From: "Mitch Vincent"
Date:
Subject: Re: postgres limitation
Next
From: "David Wall"
Date:
Subject: Re: how do you run your backups?