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-03-14T14:16:56Z
Lists: pgsql-hackers

Attachments

On Sun Dec 7, 2025 at 4:55 PM CET, Jelte Fennema-Nio 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 version attached.

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.