My application uses curl_multi_select to wait for the hangs to complete. The default timeout in curl_multi_select is set to 1 second. For a given URL, this call returns immediately to Linux, but waits for a full 1 second timeout on OSX.
Unfortunately, changing the timeout in the code is actually not an option in my situation - I need a way to change the computer configuration or use different php modules / exes.
Both linux and osx lines run PHP 5.3.8. Something seems to be related to how OSX handles sockets and the select () call itself, which is different from Linux.
Here's what the curl call does:
'url' => string 'HTTP://172.19.105.171:8070 <SNIPPED> '... (length=1439)
...
'namelookup_time' => float 1.001309
And this is what the select call looks like with dtruss:
sudo dtruss -a -n httpd > dtruss.txt.2 2>&1
PID/THRD RELATIVE ELAPSD CPU SYSCALL(args) = return
...
21524/0x17136: 14369 37 31 connect_nocancel(0xA, 0x7FFF649DB9F8, 0x6A) = 0 0
21524/0x17136: 14383 15 10 sendto_nocancel(0xA, 0x7FAA786E4AD0, 0x1C) = 28 0
20285/0x8d8d: 755608 1001045 16 select(0x0, 0x0, 0x0, 0x0, 0x7FFF64353A70) = 0 0
, select 1001045 , 1 .
- , OSX ? -, PHP/Curl? -, , select() ?
, , :
PHP/curl: namelookup_time/dns
:
http://www.somacon.com/p537.php
http://svn.php.net/viewvc/php/php-src/trunk/ext/curl/multi.c?view=markup (curl_multi_select )