dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.19k stars 4.72k forks source link

WinHttpException: Not enough storage is available to process this command #23598

Closed davidkaya closed 4 years ago

davidkaya commented 7 years ago

Hello,

I have an ASP.Net Core 2.0 server (Kestrel) on Windows Server 2016 [Standard D2s v3 (2 vcpus, 8 GB memory)] in Azure. I am trying to load test an endpoint which just sends 2 "get" and 2 "post" http requests to NoSQL database.

For load testing I use https://github.com/tsenart/vegeta from 3 computers. Throughput was approximately 15.000 rpm.

Approximately every minute it throws a lot of these exceptions and then it works correctly for a while and after some time again throws exceptions:

fail: Microsoft.AspNetCore.Server.Kestrel[13]
      Connection id "0HL7UO2PLN0UI", Request id "0HL7UO2PLN0UI:00000001": An unhandled exception was thrown by the appl
cation.
System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.WinHttpExceptio
: Not enough storage is available to process this command
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Threading.Tasks.RendezvousAwaitable`1.GetResult()
   at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext()
   --- End of inner exception stack trace ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext()

here are screenshots of graphs:

screen shot 2017-09-19 at 08 34 30 screen shot 2017-09-19 at 08 34 42

Is this just some mistake in configuration or is the problem somewhere else?

davidkaya commented 7 years ago

And this is the same application on Ubuntu 16.04LTS screen shot 2017-09-19 at 10 51 32

davidsh commented 7 years ago

In order to diagnose this, we need a way to repro this. It sounds like HttpClient is being called from your Kestrel server in reaction to clients accessing Kestrel? Please post the full Visual Studio solution to the Kestrel server and a way for us to repro this.

davidsh commented 6 years ago

Closing for lack of info to diagnose problem.