Note that there are some explanatory texts on larger screens.

plurals
  1. POcurl slow connect_time
    primarykey
    data
    text
    <p>Consider this code in a php file on my VPS server:</p> <pre><code>&lt;?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); ?&gt; </code></pre> <p>returns this</p> <pre><code>array(22) { ["url"]=&gt; string(21) "http://www.google.com" ["content_type"]=&gt; string(24) "text/html; charset=UTF-8" ["http_code"]=&gt; int(200) ["header_size"]=&gt; int(2055) ["request_size"]=&gt; int(147) ["filetime"]=&gt; int(-1) ["ssl_verify_result"]=&gt; int(0) ["redirect_count"]=&gt; int(0) ["total_time"]=&gt; float(50.095466) ["namelookup_time"]=&gt; float(0.001114) ["connect_time"]=&gt; float(50.019724) ["pretransfer_time"]=&gt; float(50.019825) ["size_upload"]=&gt; float(0) ["size_download"]=&gt; float(23156) ["speed_download"]=&gt; float(462) ["speed_upload"]=&gt; float(0) ["download_content_length"]=&gt; float(-1) ["upload_content_length"]=&gt; float(0) ["starttransfer_time"]=&gt; float(50.070702) ["redirect_time"]=&gt; float(0) ["certinfo"]=&gt; array(0) { } ["redirect_url"]=&gt; string(0) "" } </code></pre> <p>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.</p> <p>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:</p> <blockquote> <p>Tasks: 80 total, 1 running, 79 sleeping, 0 stopped, 0 zombie</p> <p>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</p> <p>Mem: 2097152k total, 1273128k used, 824024k free, 0k buffers</p> <p>Swap: 0k total, 0k used, 0k free, 0k cached</p> </blockquote> <p>I am wondering what could be the source of this issue ?</p> <p>EDIT: ADDITIONAL INFORMATION</p> <p>ping www.google.com result. It seemed like it could go on foreover so I stopped the command after the 195th line</p> <blockquote> <p>PING www.l.google.com (74.125.224.178) 56(84) bytes of data.</p> <p>64 bytes from lax02s01-in-f18.1e100.net (74.125.224.178): icmp_seq=1 ttl=56 time=12.0 ms</p> <p>64 bytes from lax02s01-in-f18.1e100.net (74.125.224.178): icmp_seq=2 ttl=56 time=12.1 ms</p> <p>64 bytes from lax02s01-in-f18.1e100.net (74.125.224.178): icmp_seq=3 ttl=56 time=11.9 ms</p> <p>...</p> <p>64 bytes from lax02s01-in-f18.1e100.net (74.125.224.178): icmp_seq=194 ttl=56 time=11.9 ms</p> <p>64 bytes from lax02s01-in-f18.1e100.net (74.125.224.178): icmp_seq=195 ttl=56 time=11.9 ms</p> <p>--- www.l.google.com ping statistics --- 195 packets transmitted, 194 received, 0% packet loss, time 194711ms</p> </blockquote> <p>traceroute wwww.google.com result</p> <blockquote> <p>traceroute to www.google.com (74.125.224.180), 30 hops max, 60 byte packets</p> <p>1 ip-<em>-</em>-*-<em>.ip.secureserver.net (</em>.*.<em>.</em>) 0.585 ms 0.642 ms 0.778 ms</p> <p>2 be10.trmd0215-01.ars.mgmt.phx3.gdg (208.109.112.126) 0.599 ms 0.777 ms 0.893 ms</p> <p>3 ip-97-74-253-122.ip.secureserver.net (97.74.253.122) 11.840 ms 12.119 ms 12.275 ms</p> <p>4 ip-97-74-253-122.ip.secureserver.net (97.74.253.122) 12.389 ms 12.482 ms 12.600 ms</p> <p>5 PR01.LAX03.google.com (206.223.123.21) 11.739 ms 11.709 ms 11.707 ms</p> <p>6 209.85.248.185 (209.85.248.185) 11.986 ms 11.797 ms 11.781 ms</p> <p>7 72.14.236.11 (72.14.236.11) 12.606 ms 12.363 ms 12.328 ms</p> <p>8 lax02s01-in-f20.1e100.net (74.125.224.180) 11.774 ms 11.864 ms 11.842 ms</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload