High CPU usage caused by using the same HttpClient instance
Published Mar 11 2019 06:41 PM 8,490 Views

High CPU usage is one of the most common issues that affects web servers. There are several root causes related to server hardware, website traffic or application code.


If you use the same instance of an object which is not thread-safe multiple times, this may increase the CPU usage. More specifically, using the same HttpClient instance from different threads increases the CPU usage.


The issue may surface in many ways. One if them is -obviously- high resource utilization. You can monitor the resource usage in Task Manager, Resource Monitor or Performance Monitor.




The official documentation for HttpClient recommends using only one instance of this object (Source HttpClient Class). However, for the scenarios where requests step on each other, it’s better to create more than one instance.




Applications shouldn’t depend on one instance of HttpClient if the requests overlap each other. Instead of calling the same instance of HttpClient, using new instances of it should help IIS to reduce CPU usage.

Version history
Last update:
‎Mar 11 2019 06:41 PM
Updated by: