The main ASP.NET concurrency application is processed by the web server. For instance:
Kestrel
var host = new WebHostBuilder() .UseKestrel(options => options.ThreadCount = 8)
In general, you should not point the number of Kestrel threads to a large value, similar to 1K because of the async-based implementation of Kestrel.
Additional information: Is Kestrel a single thread for processing requests like Node.js?
The New Kestrel Limits property was introduced in ASP.NET Core 2.0 Preview 2.
Now you can add restrictions for the following:
- Maximum client connections
- Maximum request body size
- Maximum body data rate
For instance:
.UseKestrel(options => { options.Limits.MaxConcurrentConnections = 100; }
IIS
When Kestrel runs behind a reverse proxy, you can configure the proxy itself. For example, you can configure the IIS application pool in web.config or in aspnet.config :
<configuration> <system.web> <applicationPool maxConcurrentRequestsPerCPU="5000" maxConcurrentThreadsPerCPU="0" requestQueueLimit="5000" /> </system.web> </configuration>
Of course, Nginx and Apache have their own concurrency settings.
source share