Re: Bump soft open file limit (RLIMIT_NOFILE) to hard limit on startup

Jelte Fennema-Nio <postgres@jeltef.nl>

From: "Jelte Fennema-Nio" <postgres@jeltef.nl>
To: "Andres Freund" <andres@anarazel.de>
Cc: "PostgreSQL-development" <pgsql-hackers@postgresql.org>, "Heikki Linnakangas" <hlinnaka@iki.fi>, "Tom Lane" <tgl@sss.pgh.pa.us>, "Tomas Vondra" <tomas@vondra.me>, "Peter Eisentraut" <peter@eisentraut.org>
Date: 2026-07-07T08:02:44Z
Lists: pgsql-hackers

Attachments

On Sun, 7 Dec 2025 at 16:55, Jelte Fennema-Nio <postgres@jeltef.nl> wrote:
> I needed to rebase this patch, and that made me finally take the time to
> do the restoration of the file limit for subprocesses properly

Rebased yet again

Commits

  1. Redefine max_files_per_process to control additionally opened files

  2. pgbench: Increase RLIMIT_NOFILE if necessary

  3. Move extra code out of the Pre/PostRestoreCommand() section.