-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
aspnet core 3.1 linux ThreadPool.SetMinThreads is not work #1872
Comments
I don't think this is specific to ASP.NET Core. I'm going to transfer this to dotnet/runtime and see if someone there can help. |
How does that manifest? What is the value of processorCount? What is the return value of SetMinThreads? |
For example, if the system has 4 cores, then processorCount should be 4. In Windows and Linux systems, I can normally get the value from a container of Linux docker run, but if I start the instance with k8s, it will display as follows: ThreadPool.ThreadCount: 16, Minimum work threads: 16, Minimum completion port threads: 16) It might have something to do with the k8s Settings |
Thanks, but I'm trying to understand what you mean by "is not working". What is the symptom that you're reporting? Is SetMinThreads returning false? Are you querying GetMinThreads after you call SetMinThreads and it's not reporting the values you passed in? |
cc @kouvel |
We're having the same issue: It shows exactly like you told, @stephentoub . |
Same trouble on .net core 2.2.8 in docker under linux, using microsoft/dotnet:2.2-aspnetcore-runtime as base image.
and this is the output I am getting:
The same code works fine when run locally on my Windows 10 machine. |
It sounds like it might already be configured somehow. Could be through System.Threading.ThreadPool.MinThreads, can you check in |
@kouvel |
Yea looks like historical behavior, perhaps it was intended that returning true means that the values provided are valid rather than that the values were changed. Probably could fix. |
…en they don't override the preconfigured value Fixes dotnet#1872
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
hello
aspnet core 3.1
int processorCount = Environment.ProcessorCount;
ThreadPool.SetMinThreads(processorCount * 5, processorCount * 100);
run in docker is not working by linux ,
but can working in windows ,why?
who can help me, thinks
The text was updated successfully, but these errors were encountered: