Greshko, thx.
 

baobeileaf
 
From: Ed Greshko
Date: 2013-11-04 16:39
To: KDE on Fedora discussion
CC: baobeileaf
Subject: Re: why dig (tcp) is much faster than wget (gethostbyname?) ?
On 11/04/13 15:08, baobeileaf wrote:
> hi guys,
>  
> check this out:
>  
> [root@localhost /]# time dig www.hyblr.com +tcp
>  
> ; <<>> DiG 9.9.3-rl.156.01-P1-RedHat-9.9.3-3.P1.fc18 <<>> www.hyblr.com +tcp
> ;; global options: +cmd
> ;; Got answer:
> ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35033
> ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 1
>  
> ;; OPT PSEUDOSECTION:
> ; EDNS: version: 0, flags:; udp: 4096
> ;; QUESTION SECTION:
> ;www.hyblr.com.                 IN      A
>  
> ;; ANSWER SECTION:
> www.hyblr.com.          3       IN      A       111.8.98.138
>  
> ;; AUTHORITY SECTION:
> www.hyblr.com.          3518    IN      NS      ns2.hyblr.com.
> www.hyblr.com.          3518    IN      NS      ns3.hyblr.com.
> www.hyblr.com.          3518    IN      NS      ns1.hyblr.com.
>  
> ;; Query time: 10 msec
> ;; SERVER: 111.8.14.18#53(111.8.14.18)
> ;; WHEN: Mon Nov 04 14:56:40 CST 2013
> ;; MSG SIZE  rcvd: 112
>  
>  
> real    0m0.040s
> user    0m0.014s
> sys     0m0.018s
>  
> [root@localhost /]# time wget -O /dev/null  www.hyblr.com
> --2013-11-04 14:55:18--  http://www.hyblr.com/
> Resolving www.hyblr.com (www.hyblr.com)... 111.8.98.138
> Connecting to www.hyblr.com (www.hyblr.com)|111.8.98.138|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: unspecified [text/html]
> Saving to: ¡®/dev/null¡¯
>  
>     [ <=>                                                                                                                ] 81,980      --.-K/s   in 0.05s   
>  
> 2013-11-04 14:55:33 (1.44 MB/s) - ¡®/dev/null¡¯ saved [81980]
>  
>  
> real    0m15.203s
> user    0m0.007s
> sys     0m0.014s
>  
>  
> I've read the sourcecode of wget. Maybe the difference comes from gethostbyname.
> Anyone can help me? or tell me where's the sourcecode of gethostbyname.
>
 
I think the question you should be asking is this.....
 
[egreshko@meimei ~]$ time wget -O /dev/null  www.hyblr.com
--2013-11-04 16:36:01--  http://www.hyblr.com/
Resolving www.hyblr.com (www.hyblr.com)... 111.8.98.138
Connecting to www.hyblr.com (www.hyblr.com)|111.8.98.138|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ¡®/dev/null¡¯
 
    [  <=>                                    ] 81,736       225KB/s   in 0.4s  
 
2013-11-04 16:36:17 (225 KB/s) - ¡®/dev/null¡¯ saved [81736]
 
 
real    0m15.498s
user    0m0.003s
sys     0m0.004s
 
as opposed to this....
 
[egreshko@meimei ~]$ time wget -O /dev/null  111.8.98.138
--2013-11-04 16:36:50--  http://111.8.98.138/
Connecting to 111.8.98.138:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ¡®/dev/null¡¯
 
    [  <=>                                    ] 81,980       261KB/s   in 0.3s  
 
2013-11-04 16:36:50 (261 KB/s) - ¡®/dev/null¡¯ saved [81980]
 
 
real    0m0.437s
user    0m0.003s
sys     0m0.002s
 
And then notice this....
 
[egreshko@meimei ~]$ host www.hyblr.com
www.hyblr.com has address 111.8.98.138
;; connection timed out; trying next origin
Host www.hyblr.com not found: 3(NXDOMAIN)
Host www.hyblr.com not found: 3(NXDOMAIN)
 
I suspect a DNS configuration issue for that host/domain.
 
-- 
Getting tired of non-Fedora discussions and self-serving posts