Re: How to simulate crashes of PostgreSQL?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Vick Khera <vivek(at)khera(dot)org>, Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to simulate crashes of PostgreSQL?
Date: 2009-08-28 04:57:25
Message-ID: 1857.1251435445@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alvaro Herrera <alvherre(at)commandprompt(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sébastien Lardière 2009-08-28 08:13:31 Re: [Skytools-users] WAL Shipping + checkpoint
Previous Message Greg Stark 2009-08-28 03:36:51 Re: How to simulate crashes of PostgreSQL?