I just installed CentOS7 (3.10.0-229.4.2.el7.x86_64) with nginx (1.8.0). Here my hosts file:
[root@ser_main1 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.0.1 arm.site.com kpp.site.com w.site.com server.site.com
And problem:
[root@ser_main1 ~]# time curl http://arm.site.com/test/fad/site/site?siteId=152
{"OK"}
real 0m0.162s
user 0m0.003s
sys 0m0.003s
[root@ser_main1 ~]# time curl http://127.0.0.1/test/fad/site/site?siteId=152
{"OK"}
real 0m0.011s
user 0m0.002s
sys 0m0.003s
Why can be such big difference? 0m0.162s and 0m0.011s
Here my nsswitch.conf:
passwd: files sss
shadow: files sss
group: files sss
hosts: files dns myhostname
bootparams: nisplus [NOTFOUND=return] files
ethers: files
netmasks: files
networks: files
protocols: files
rpc: files
services: files sss
netgroup: files sss
publickey: nisplus
automount: files
aliases: files nisplus
Just tested it on Fedora Server, and there is no such problems... I dont know what to do...
strace show some timeout
And i found that it is bug in curl_7.29.0 . Here link. And Answer