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 8148817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:43:11+00:00 2026-06-06T14:43:11+00:00

Consider this code in a php file on my VPS server: <?php $url =

  • 0

Consider this code in a php file on my VPS server:

<?php $url = 'http://www.google.com';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3)     Gecko/20041001 Firefox/0.10.1" );
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$content = curl_exec($ch);
$ci = curl_getinfo($ch);
curl_close($ch);
var_dump($ci); ?>

returns this

array(22) { 
["url"]=> string(21) "http://www.google.com" 
["content_type"]=> string(24) "text/html; charset=UTF-8" 
["http_code"]=> int(200) 
["header_size"]=> int(2055) 
["request_size"]=> int(147) 
["filetime"]=> int(-1) 
["ssl_verify_result"]=> int(0) 
["redirect_count"]=> int(0) 
["total_time"]=> float(50.095466) 
["namelookup_time"]=> float(0.001114) 
["connect_time"]=> float(50.019724) 
["pretransfer_time"]=> float(50.019825) 
["size_upload"]=> float(0) 
["size_download"]=> float(23156) 
["speed_download"]=> float(462) 
["speed_upload"]=> float(0) 
["download_content_length"]=> float(-1) 
["upload_content_length"]=> float(0) 
["starttransfer_time"]=> float(50.070702) 
["redirect_time"]=> float(0) 
["certinfo"]=> array(0) { } 
["redirect_url"]=> string(0) 
"" }

After testing at several times of day, the “connect_time” is consistently at the 50 seconds mark. I believe it should be 10X faster if not at the 1 second mark and below.

I’m not knowledgeable with server config but I was told that my server’s CPU or RAM could be at fault. I used the top command line to display the following which seems fine to me:

Tasks: 80 total, 1 running, 79 sleeping, 0 stopped, 0 zombie

Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si,
0.0%st

Mem: 2097152k total, 1273128k used, 824024k free, 0k
buffers

Swap: 0k total, 0k used, 0k free, 0k
cached

I am wondering what could be the source of this issue ?

EDIT: ADDITIONAL INFORMATION

ping http://www.google.com result. It seemed like it could go on foreover so I stopped the command after the 195th line

PING http://www.l.google.com (74.125.224.178) 56(84) bytes of data.

64 bytes from lax02s01-in-f18.1e100.net (74.125.224.178): icmp_seq=1
ttl=56 time=12.0 ms

64 bytes from lax02s01-in-f18.1e100.net (74.125.224.178): icmp_seq=2
ttl=56 time=12.1 ms

64 bytes from lax02s01-in-f18.1e100.net (74.125.224.178): icmp_seq=3
ttl=56 time=11.9 ms

…

64 bytes from lax02s01-in-f18.1e100.net (74.125.224.178): icmp_seq=194
ttl=56 time=11.9 ms

64 bytes from lax02s01-in-f18.1e100.net (74.125.224.178): icmp_seq=195
ttl=56 time=11.9 ms

— http://www.l.google.com ping statistics — 195 packets transmitted, 194 received, 0% packet loss, time 194711ms

traceroute wwww.google.com result

traceroute to http://www.google.com (74.125.224.180), 30 hops max, 60 byte
packets

1 ip-–-*-.ip.secureserver.net (.*..) 0.585 ms
0.642 ms 0.778 ms

2 be10.trmd0215-01.ars.mgmt.phx3.gdg (208.109.112.126) 0.599 ms
0.777 ms 0.893 ms

3 ip-97-74-253-122.ip.secureserver.net (97.74.253.122) 11.840 ms
12.119 ms 12.275 ms

4 ip-97-74-253-122.ip.secureserver.net (97.74.253.122) 12.389 ms
12.482 ms 12.600 ms

5 PR01.LAX03.google.com (206.223.123.21) 11.739 ms 11.709 ms
11.707 ms

6 209.85.248.185 (209.85.248.185) 11.986 ms 11.797 ms 11.781 ms

7 72.14.236.11 (72.14.236.11) 12.606 ms 12.363 ms 12.328 ms

8 lax02s01-in-f20.1e100.net (74.125.224.180) 11.774 ms 11.864 ms
11.842 ms

  • 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-06T14:43:12+00:00Added an answer on June 6, 2026 at 2:43 pm

    Try:

    curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); 
    

    The above will prevent cURL from trying IPv6 first.

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

Sidebar

Related Questions

Consider this code: Dim strUrl As String = http://www.txtguru.in/imobile/api.php?username=username&password=password&source=senderid&dmobile=123456789012&message=message Dim request As WebRequest =
Consider the following code: public ActionResult Index(String URLQuery = http://www.google.com) { HttpWebRequest webRequest; HttpWebResponse
Consider the following scenario: http://www.restserver.com/example.php returns some content that I want to work with
Consider the following code: <?php $conn = mysql_connect('localhost', 'username', 'password'); mysql_select_db('database', $conn); ?> This
Consider, I've got this code in PHP <?php if($count==0) { ?> <script> show_my_div(); </script>
Please consider the following structure of my website: www.mydomain.com/ www.mydomain.com/index.php www.mydomain.com/404.php www.mydomain.com/css www.mydomain.com/blog/ How
Consider this code snippet: $('#selectone').change(function(){ var amount; $.get('search.php', {search:'units'}, function(result){ //this will return only
Consider the following: $url = 'http://psyng.com/u/9716602b'; $headers = get_headers($url, 1); print_r($headers); Since the domain
Consider this code: enum { ERR_START, ERR_CANNOTOPENFILE, ERR_CANNOTCONNECT, ERR_CANNOTCONNECTWITH, ERR_CANNOTGETHOSTNAME, ERR_CANNOTSEND, }; char* ERR_MESSAGE[]
Consider this code: if(initscr() == NULL) ERROR(Cannot start ncurses mode.\n); keypad(stdscr, TRUE); cbreak(); int

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.