Pitfalls of HttpClient in .NET
Continuing the series of articles about "pitfalls" I can not ignore System.Net.HttpClient, which is very often used in practice, but it has several serious problems that may not be immediately visible.
A fairly common problem in programming is that developers only focus on the functionality of a component, while completely ignoring a very important nonfunctional component that can affect performance, scalability, ease of recovery in case of failures, security, etc. For example, the same HttpClient is a seemingly elementary component, but there are several questions: how many it creates parallel connections to the server, how long they live, how it behaves, if the DNS name accessed previously is switched to another IP address ? Let's try to answer these questions in the article.
Leakage of connections
The limit of simultaneous connections to the server
Long-lived connections and caching DNS
https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests . And in addition to managing the lifetime of the connections, the new component provides the ability to create typed clients, as well as some other useful things. In this article and links there are enough information and examples on using HttpClientFactory, so I will not consider the details related to it in this article.
It may be interesting
Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work!
Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.
This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck.
Hey what a brilliant post I have come across and believe me I have been searching out for this similar kind of post for past a week and hardly came across this. Thank you very much and will look for more postings from you. [Url = https: //mtsoul.net] 먹튀 검증 [/ url]