BadHttpRequestException and Performance Problems in .NET Core Web API

mko0653224

New member
Joined
Aug 1, 2021
Messages
1
Programming Experience
10+
I am running a fairly standard .NET Core Web API running in Google App Engine and while my API controllers are naturally asynchronous, my business layer runs synchronously. I am using EF with a MySQL database and anytime my API takes on more than 10+ requests at once, I start to see this exception everywhere and my API performance grinds to a halt.

I have a beefing PaaS configurations with elasticity enabled for both of my App Engine and Cloud SQL configurations. I know I could save some performance by turning my business tier into async calls but should my API be grinding to halt with such low volume? What else could I be doing wrong?

Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Unexpected end of request content.

Thanks in advance!
 
Without seeing your code it's hard to give a definitive answer. My guess is that Kestrel only supports a limited number of threads to handle pending HTTP requests, and the synchronous nature of your business layer is keeping those threads busy.

Do you get the same behavior running your app with an IIS front end instead of what I am guessing is a simple Apache reverse proxy when running on Google App Engine?
 
Back
Top Bottom