journal: bump RLIMIT_NOFILE when journal files to 16K (if possible)
When there are a lot of split out journal files, we might run out of fds quicker then we want. Hence: bump RLIMIT_NOFILE to 16K if possible. Do these even for journalctl. On Fedora the soft RLIMIT_NOFILE is at 1K, the hard at 4K by default for normal user processes, this code hence bumps this up for users to 4K. https://bugzilla.redhat.com/show_bug.cgi?id=1179980
This commit is contained in:
@@ -7409,6 +7409,11 @@ int main(int argc, char*argv[]) {
|
||||
goto finish;
|
||||
}
|
||||
|
||||
/* Increase max number of open files to 16K if we can, we
|
||||
* might needs this when browsing journal files, which might
|
||||
* be split up into many files. */
|
||||
setrlimit_closest(RLIMIT_NOFILE, &RLIMIT_MAKE_CONST(16384));
|
||||
|
||||
if (!avoid_bus())
|
||||
r = bus_open_transport_systemd(arg_transport, arg_host, arg_scope != UNIT_FILE_SYSTEM, &bus);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user