curl / Mailing Lists / curl-library / Single Mail


Frequent calls of CURLMOPT_TIMERFUNCTION with Multi Interface

From: Nick Kostirya via curl-library <>
Date: Tue, 26 Mar 2019 09:32:01 +0200


I found that CURLMOPT_TIMERFUNCTION callback is often called with 0 value.
This happens when resolver thread is working.
What for?

Because of this the main thread makes a lot of empty calls:
1) timer_callback
2) select (epoll) with 0 second
3) curl_multi_socket_action with CURL_SOCKET_TIMEOUT
and again timer_callback many times

CPU is used on 100% if resolver do not found info in cache.

I found what worked similarly.
300 system calls (kevent, epoll) are for one url.
And 52 system calls before as file /etc/resolv.conf is opened.

How do I solve this problem?

Received on 2019-03-26