curl / Mailing Lists / curl-library / Single Mail


Multiple DNS resolution threads are spawned for same host/port for a multi-handle

From: mandar choure <>
Date: Wed, 22 Mar 2017 22:44:52 +0530

We are facing an issue with the CPU utilization when multiple threads are
spawned for the DNS resolution for the same host id and port for easy
handle belonging to same multi-handle.

- libcurl version - 7.51.0 ( Windows )
- build with multi-threaded
- libcurl CURLOPT_DNS_CACHE_TIMEOUT - 60 seconds
- HTTP timeout - 13 seconds
- 21 Easy handles added to the multi-handle

Detailed description:
We are observing CPU utilization to 100% under load testing when libcurl
started to spawn multiple threads to resolve DNS.
In our case we are using same HTTP url and port to post the curl request.

So it should not spawn multiple threads for DNS resolution for same url. In
our case we are observing the DNS resolution is taking some time and during
that interval if another requests comes in it creates another threads and
thread count increases by 30 under load.

Question is, what is the best way to handle this problem.


Received on 2017-03-22