Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is .NET 5 HttpClient performance better than .NET6? #1

Open
suchoss opened this issue Apr 18, 2022 · 0 comments
Open

Why is .NET 5 HttpClient performance better than .NET6? #1

suchoss opened this issue Apr 18, 2022 · 0 comments

Comments

@suchoss
Copy link
Owner

suchoss commented Apr 18, 2022

Why is .NET 5 HttpClient performance better than .NET6?

Or is it?

In this solution I tried to find out why is .NET 5 working "correctly" when using NEST library, while .NET 6 is failing quite quickly when running more requests/s. What I found out is that .NET 5 HttpClientFactory behaves differently from .NET 6 HttpClientFactory.

It seems that the HttpClientFactory for .NET 6 is less performant than the one for .NET 5

.NET5

  • it can handle over 100 requests/s without creating new threads
  • only about 40 requests are really outgoing
  • more requests created mean that less requests are really sent

.NET6

  • it can not handle more than 100 requests/s without creating new threads
  • after more than 100 requests/s the app starts creating new threads locked in waiting until it ultimately fails
  • only about 40 requests are really outgoing
  • more requests created mean that less requests are really sent

Am I doing something wrong?

Is .NET 5 more performant, or does that mean it swallows some errors and we don't know about them?
Why .NET 6 is so quickly depleting TCP connections leading to rapid grow of threads?

Below is my original issue created on Elasticsearch Github project

Picture from elastic/elasticsearch-net#6342 (comment)
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant