Re: How to simulate crashes of PostgreSQL? - Mailing list pgsql-general

From Tom Lane
Subject Re: How to simulate crashes of PostgreSQL?
Date
Msg-id 1857.1251435445@sss.pgh.pa.us
Whole thread Raw
In response to Re: How to simulate crashes of PostgreSQL?  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-general
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Maybe we should have another inter-backend signal: when a process gets
> ENFILE, signal all other backends and they close a bunch of files each.

I was wondering about that myself, but on balance I think it'd be a lot
of work to achieve not much.  What you would have is that Postgres would
ramp its FD usage up to hit the kernel limit, things outside the
database would fail for some period of time, then a backend would get
ENFILE and we'd cut down our FD usage.  Lather, rinse, repeat, ad
infinitum.  You'd have intermittent hard-to-reproduce failures of every
other service on the box; and you'd *still* be at risk of the DB
crashing, if walwriter or another low-cushion process hit the problem
first.

The only really reliable setup is to have max_connections times
max_files_per_process less than the kernel limit.  If we do something to
mask the problem when it happens, I don't think we're doing the DBA a
service in the long run.

Thought: it's probably possible to find out the kernel limit on many
platforms.  Maybe postmaster startup should try to get that limit, and
print an annoying warning if it's less than max_connections times
max_files_per_process plus some safety factor?

            regards, tom lane

pgsql-general by date:

Previous
From: Greg Stark
Date:
Subject: Re: How to simulate crashes of PostgreSQL?
Next
From: Sébastien Lardière
Date:
Subject: Re: [Skytools-users] WAL Shipping + checkpoint