mirror of
https://github.com/microsoft/WSL.git
synced 2025-12-10 17:47:59 -06:00
Increase file descriptor limit in wsla init (#13524)
This commit is contained in:
parent
7e7bc436df
commit
87a7546638
@ -637,7 +637,20 @@ int WSLAEntryPoint(int Argc, char* Argv[])
|
|||||||
g_LogFd = 3;
|
g_LogFd = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Increase the soft and hard limit for number of open file descriptors.
|
||||||
|
// N.B. the soft limit shouldn't be too high. See https://github.com/microsoft/WSL/issues/12985 .
|
||||||
|
//
|
||||||
|
|
||||||
rlimit Limit{};
|
rlimit Limit{};
|
||||||
|
Limit.rlim_cur = 1024 * 10;
|
||||||
|
Limit.rlim_max = 1024 * 1024;
|
||||||
|
if (setrlimit(RLIMIT_NOFILE, &Limit) < 0)
|
||||||
|
{
|
||||||
|
LOG_ERROR("setrlimit(RLIMIT_NOFILE) failed {}", errno);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
Limit.rlim_cur = 0x4000000;
|
Limit.rlim_cur = 0x4000000;
|
||||||
Limit.rlim_max = 0x4000000;
|
Limit.rlim_max = 0x4000000;
|
||||||
if (setrlimit(RLIMIT_MEMLOCK, &Limit) < 0)
|
if (setrlimit(RLIMIT_MEMLOCK, &Limit) < 0)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user