profile
viewpoint

Ask questionsBadHttpRequestException: Reading the request body timed out due to data arriving too slowly

We have an asp.net core 2.1 app running on .net 4.7 in azure web app service.

Recently we started getting A LOT of the following error:

Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Reading the request body timed out due to data arriving too slowly. See MinRequestBodyDataRate.

Our app is under pretty constant heavy load (from incoming webhooks mostly). During big spikes, we tend to see more of these.

We used to run on asp.net core 2.0 / .net 4.6.1 for many months and we never saw that error before. It seems to have started happening following our recent upgrade to asp.net core 2.1 / .net 4.7.

We'd like to get to the bottom of this issue, but we are not even sure where to start. Any thoughts?

aspnet/AspNetCore

Answer questions alastairs

We're seeing the same issue in production, along with a related BadHttpRequestException triggering a 400 response: "Unexpected end of request content". We have little insight into what is causing this problem, but as little as 1 request/second with a 600KB request body will trigger it. It seems to be exacerbated by unreliable client connections, such as over mobile/cellular 3G networks. We see no related spikes in CPU or memory consumption at the time when these occur.

useful!

Related questions

HTTP Error 500.31 - ANCM Failed to Find Native Dependencies hot 123
The SPA default page middleware could not return the default page '/index.html' in production application hot 102
The SPA default page middleware could not return the default page '/index.html' in production application hot 96
Asp.Net MVC Core: “Error unprotecting the session cookie” exception hot 79
No DefaultChallengeScheme found from preview8 to preview9 hot 67
Method not found: 'Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder`1.HasIndex(System.Linq.Expressions.Expression`1<System.Func`2<System.__Canon,System.Object>>)'. hot 59
The library &#39;hostpolicy.dll&#39; required to execute the application was not found - AspNetCore hot 58
error CS1503: Argument 2: cannot convert from 'method group' to 'EventCallback' hot 57
Error: Invocation canceled due to the underlying connection being closed. hot 54
Unexpected end of request content k8s pod - AspNetCore hot 53
Using 'UseMvc' to configure MVC is not supported while using Endpoint Routing. To continue using 'UseMvc', please set 'MvcOptions.EnableEndpointRounting = false' inside 'ConfigureServices'. hot 50
IIS in-process hosting incorrectly throws ConnectionResetException for HTTP POST hot 47
HTTP Error 500.30 - ANCM In-Process Start Failure hot 43
Error: Server returned handshake error: Handshake was canceled. hot 43
Issue with BuildServiceProvider() in ConfigureServices() hot 42
source:https://uonfu.com/
Github User Rank List