-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dotnet on OSX is limited to 10240 file handles #112726
Comments
Tagging subscribers to this area: @dotnet/area-system-io |
It is possible to compile a version that works around this on the mac for v8.0.13 by applying the attached diff then compiling with: Doing that does prevent things like dotnet-dump from running, I think because of unsigned code. |
An easier workaround is to just intercept the sys call:
Compile it:
Include the following env var in any dotnet apps:
|
This code pre-dates me (last touched 8 years ago!), but my understanding is that we increase the default limit to the max allowed limit: runtime/src/coreclr/pal/src/init/pal.cpp Lines 944 to 945 in eab352d
runtime/src/coreclr/pal/src/init/pal.cpp Lines 965 to 970 in eab352d
|
@LukeButters based on our experience it seems that Apple has changed the behavior since 2017 when I have added the limitation to OPEN_MAX, as it was really failing. See dotnet/coreclr#14054 description for details. I'd be happy to accept a PR removing that artificial clipping if you prepared it. |
I had a look at what For context:
The result of
This means the current behaviour results in the I was also concerned about setting the value to |
Should we simply disable this method for apple platforms? |
By default macos has a crazy low soft limit of 256!
If a concern exists around backwards compatibility, we could on apple machines set the current limit to:
so if the user has already set a soft limit that exceeds OPEN_MAX we use what the user has set. If the user has a soft limit below rlim_max, we increase the soft limit up to the smaller of rlim_max and OPEN_MAX. Doing that means:
|
Description
Dotnet on mac is limited to only 10240 file handles, this occurs because:
runtime/src/coreclr/pal/src/init/pal.cpp
Lines 964 to 971 in eab352d
on OS X15.2 OPEN_MAX is defined as:
I got that from
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/sys/syslimits.h
, another mac user got the same line fromsys/resource.h
.The man page for setrlimit mentions:
Compiling my own version where those three lines are commented out, does result in a dotnet where I can open well over 10k files (my test ran to 250K files before I stopped it).
It would be useful if that artificial limit did not apply to the released version of dotnet.
Reproduction Steps
Expected behavior
Can open more than 10240 files.
Actual behavior
fails to open more than 10kish files.
Regression?
no
Known Workarounds
none
Configuration
.net 8.0.13
Other information
No response
The text was updated successfully, but these errors were encountered: