Why would curl ignore CURLOPT_TIMEOUT_MS (but honor CURLOPT_TIMEOUT)?
I have observed, similar issue on CentOS 5.4 system running curl version 4.3.0 and it seems whenever curl is built to use 'standard system name resolver', this behaviour kicks in.
Work around is to use 'CURLOPT_NOSIGNAL' option along with 'CURLOPT_TIMEOUT_MS'; however this may have it's own consequences.
Check out details on following page:https://ravidhavlesha.wordpress.com/2012/01/08/curl-timeout-problem-and-solution/