简体   繁体   中英

Which component is handling thread allocation in ASP.NET Core?

In previous versions of asp.net the framework was responsible for allocating all the threads from thread pool and there was a configuration in the web.config to set it up (maximum number of threads, etc.). So which component is responsible for it in the new ASP.NET? I have not found any special middleware for that, I guess that it should happen even before the middleware, maybe in Kestrel.

The threadpool is a CLR resource that can be configured directly in your Startup https://msdn.microsoft.com/en-us/library/system.threading.threadpool%28v=vs.110%29.aspx .

I think what you're actually asking about is configuring how many threads the servers will use to process requests, correct? See https://github.com/aspnet/KestrelHttpServer/blob/01e9101543906ffd39239efd2f7bb41dbd879902/src/Microsoft.AspNetCore.Server.Kestrel/KestrelServerOptions.cs#L90

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM