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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Bump soft open file limit (RLIMIT_NOFILE) to hard limit on startup
Дата
Msg-id 849933.1739814039@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Bump soft open file limit (RLIMIT_NOFILE) to hard limit on startup  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2025-02-12 22:52:52 +0100, Jelte Fennema-Nio wrote:
>> +                /*
>> +                 * Bump the soft limit to the hard limit to not run into low
>> +                 * file limits.
>> +                 */
>> +                rlim.rlim_cur = rlim.rlim_max;
>> +                if (setrlimit(RLIMIT_NOFILE, &rlim) == -1)
>> +                    pg_fatal("setrlimit failed: %m");
>> +
>> if (rlim.rlim_cur < nclients + 3)

> Why not do this only in the if (rlim.rlim_cur < nclients + 3) case?

+1, otherwise you're introducing a potential failure mode for nothing.
It'd take a couple extra lines to deal with the scenario where
rlim_max is still too small, but that seems fine.

> Other than this I think we should just apply this.

Agreed on the pgbench change.  I don't have an opinion yet on the
server changes.

            regards, tom lane



В списке pgsql-hackers по дате отправления: