I have a ASP.NET Core 2.0 webservice running on IIS. One of controller\'s methods looks more or less like this:
[HttpGet()]
public IActionResult Test()
{
//
It looks like your throughput drops below the minimum data rate. This behavior is described in Kestrel Fundamentals:
Kestrel checks every second if data is coming in at the specified rate in bytes/second. If the rate drops below the minimum, the connection is timed out. The grace period is the amount of time that Kestrel gives the client to increase its send rate up to the minimum; the rate is not checked during that time. The grace period helps avoid dropping connections that are initially sending data at a slow rate due to TCP slow-start.
The default minimum rate is 240 bytes/second, with a 5 second grace period.
A minimum rate also applies to the response. The code to set the request limit and the response limit is the same except for having
RequestBody
orResponse
in the property and interface names.
You can configure this in Program.cs like this:
var host = new WebHostBuilder()
.UseKestrel(options =>
{
options.Limits.MinResponseDataRate = null;
})
Setting this option to null
indicates no minimum data rate should be enforced.