Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7999829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:36:52+00:00 2026-06-04T15:36:52+00:00

EDIT: Found part of the cause – see bottom. I’m doing a standard curl

  • 0

EDIT: Found part of the cause – see bottom.

I’m doing a standard curl call from php. However, there seems to be a hangup during name resolution.
On my OSX box, the namelookup_time is over 1 second consistently for this and other queries to the same subnet.
A linux box on my subnet doing the same query has a 0.02 second response to the other subnet, so it’s a problem with my box.

This is a problem since our app makes many calls to this subnet to build a page, so the seconds add up.

My curl_getinfo response (url snipped out)

array
  'url' => string ' < SNIPPED > '... (length=1449)
  'content_type' => string 'text/plain; charset=utf-8' (length=25)
  'http_code' => int 200
  'header_size' => int 227
  'request_size' => int 1480
  'filetime' => int -1
  'ssl_verify_result' => int 0
  'redirect_count' => int 0
  'total_time' => float 1.165444
  'namelookup_time' => float 1.001272
  'connect_time' => float 1.017765
  'pretransfer_time' => float 1.017781
  'size_upload' => float 0
  'size_download' => float 92562
  'speed_download' => float 79422
  'speed_upload' => float 0
  'download_content_length' => float 92562
  'upload_content_length' => float 0
  'starttransfer_time' => float 1.043094
  'redirect_time' => float 0
  'certinfo' => 
    array
      empty
  'redirect_url' => string '' (length=0)

I have a suspicion that the name lookup lag is due to IPv6, so I tried the following:

1) Followed the directions here to turn off Ipv6 on OSX, including reboot. I set all instances of IPv6 to INACTIVE like the article suggested.

http://community.centrify.com/t5/Express-for-Mac-Tips-and-Tricks/Using-local-domains-with-Centrify-Directcontrol-on-the-Mac/ba-p/3724

I confirmed that my Mac didn’t have IPv6 support here: http://ipv6test.google.com/.

2) Rebuilt PHP with –disable-ipv6.

php -i shows: IPv6 Support => disabled

although in the curl section, it says “IPv6 => Yes”, and I don’t know how to surgically turn this off.

3) Ran this before the curl call:

curl_setopt($c, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );

Unfortunately, none of the above steps worked – I’m still getting 1 sec+ name resolution times. Does anyone have any troubleshooting suggestions, or better yet, a magic bullet? 🙂

(Note – I’ve googled and SO’ed this question, but to no avail..)

Edit: answering ckhan’s questions below:
1) I get the same 1 sec+ namelookup_time using an IP address or a FQDN:

'url' => string 'HTTP://172.19.105.171:8070  <SNIPPED> '... (length=1439)
...
'namelookup_time' => float 1.001309

2) The command line client doesn’t have the same problem:

# url.txt has the same url as the above curl call
time cat url.txt |xargs curl
<... response output ...>
real  0m0.053s
user  0m0.009s
sys 0m0.008s

3) dig seems to have no problem with accessing the server.

dig 172.19.105.171
...
;; Query time: 77 msec
...

My environment:
PHP 5.3.8
OSX 10.7.3

Partial solution

The app code is using curl_multi_select, which has a default timeout of 1 second.
Changing this delay to 0.00005 seconds makes the call return much faster. So that’s what’s causing the delay. However, I don’t yet know why this is different on Linux vs OSX or the particular flavor of php/libcurl that I have built (5.3.8).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T15:36:54+00:00Added an answer on June 4, 2026 at 3:36 pm

    The PHP app code is using curl_multi_select, which has a default timeout of 1 second. Changing this delay to 0.00005 seconds makes the call return much faster. So that’s what’s causing the delay. However, I don’t yet know why this is different on Linux vs OSX or the particular flavor of php/libcurl that I have built (5.3.8).

    I’m going to open a different SO question to try to resolve the curl_multi_select issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT 23-06-2012 10:24 (CET) : Found the answer Take a look at the bottom
EDIT: The entire code and database creation script can be found from http://gitorious.org/scheator .
FINAL EDIT: After following the answer from Darin Dimitrov, I have found that the
[edit] Found the solution. Reinstall EVERYTHING - xcode, mono, monodevelop and monotouch. Now it
EDIT : I found classloader leak in my webapplication. It boils down to 3rd
EDIT: I've found what's causing the issue, but I don't know why and I
EDIT 9-3-10: I found this blog entry recently that was very enlightening. http://optimizermagic.blogspot.com/2007/12/outerjoins-in-oracle.html There
Edit #2: i disabled my 404 page and the default not found page says
I'm going to edit an ImageField using jquery ajax,after searching I found out I
I have been told to edit this file in Sharepoint Designer: /_layouts/KWizCom_WikiPlus/CreateNew.aspx I found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.