"localhost" vs "127.0.0.1" performance
I've setup an XML-RPC server/client communication under Windows. What I've noticed is that if exchanged data volume become huge, there's a difference in starting the server listening on "localhost" vs. "127.0.0.1". If "127.0.0.1" is set, the communication speed is faster than using "localhost". Could somebody explain why? I thought it could be a matter on naming resolving, but....locally too?
Every domain name is resolving. No exception inculuding local site. When you make request to localhost
, localhost's ip resolve by host
file in every time. In Windows host
file control this. But if you make request to 127.0.0.1
ip adress is aldready resolved. And requst goes directly this ip.
上一篇: 我如何检查node.js事件队列?