Re: Bump soft open file limit (RLIMIT_NOFILE) to hard limit on startup - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Bump soft open file limit (RLIMIT_NOFILE) to hard limit on startup
Date
Msg-id 3226911.1739314539@sss.pgh.pa.us
Whole thread Raw
In response to Re: Bump soft open file limit (RLIMIT_NOFILE) to hard limit on startup  (Andres Freund <andres@anarazel.de>)
Responses Re: Bump soft open file limit (RLIMIT_NOFILE) to hard limit on startup
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> In the current version of the AIO patchset, the creation of those io_uring
> instances does happen as part of an shmem init callback, as the io uring
> creation also sets up queues visible in shmem.

Hmm.

> So the issue would actually be that we're currently doing set_max_safe_fds()
> too late, not too early :/

Well, we'd rather set_max_safe_fds happen after semaphore creation,
so that it doesn't have to be explicitly aware of whether semaphores
consume FDs.  Could we have it be aware of how many FDs *will be*
needed for io_uring, but postpone creation of those until after we
jack up RLIMIT_NOFILE?

I guess the other way would be to have two rounds of RLIMIT_NOFILE
adjustment, before and after shmem creation.  That seems ugly but
shouldn't be very time-consuming.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Bump soft open file limit (RLIMIT_NOFILE) to hard limit on startup
Next
From: Nathan Bossart
Date:
Subject: Re: describe special values in GUC descriptions more consistently