C****n 发帖数: 2324 | 1 I have a Router, connect to a switch, then connected to a couple servers.
One server has an IP of: 192.168.21.142, and I have installed a website on
it, with a single file: techdiff.html
I then create a httpget.exe using c#, this application will get the URL
content and write to console.
I can access the file by:
httpget http://192.168.21.142:8082/techdiff.html
And I can also access the file by:
httpget http://127.0.0.1:8082/techdiff.html
Question is: using 127.0.0.1 is super fast.
using: 192.168.21.142 is slow, take me about two seconds!
I thought they are the same, not sure why it's slow. Does it travel outside
of the computer?
Even that, who can give me some advice what could be the possible reason
that it's so slow? As even it travelled outside of the server, it still
should not be that slow! | s******v 发帖数: 4495 | 2 so ur web svr and httpget.exe are on the same host, right? which os, i
assume it is a windows because the .exe/c#. any firewall installed?
【在 C****n 的大作中提到】 : I have a Router, connect to a switch, then connected to a couple servers. : One server has an IP of: 192.168.21.142, and I have installed a website on : it, with a single file: techdiff.html : I then create a httpget.exe using c#, this application will get the URL : content and write to console. : I can access the file by: : httpget http://192.168.21.142:8082/techdiff.html : And I can also access the file by: : httpget http://127.0.0.1:8082/techdiff.html : Question is: using 127.0.0.1 is super fast.
| n*********a 发帖数: 1956 | 3 127.0.0.1 is a faked virtual interface for loopback. It doesn't get into
any real network interface card. This saves lots of processing delay inside
the protocol stack. You can simply "ping 127.0.0.1" and see the
performance difference. | x*********n 发帖数: 28013 | 4 192.168.x。x
first of all, this is a private IP, how can you reach a private IP when you
are outside of the network?
For internet users to access the website, they are hitting the public IP
first, then NAT to private, firewall or router usually do the NAT job.
Most likely, check your firewall.
for internal visit, firewall rule is also possible if you and the server are
under the different area, server usually located at DMZ zone, you are user
zone.
To isolate the issue, connect you PC to switch, if speed is fine, then begin
to check the network device.Otherwise, could be just application issue.. | v**n 发帖数: 951 | 5 Windows十分的NC. 在linux上这两个的性能是十分接近的。
inside
【在 n*********a 的大作中提到】 : 127.0.0.1 is a faked virtual interface for loopback. It doesn't get into : any real network interface card. This saves lots of processing delay inside : the protocol stack. You can simply "ping 127.0.0.1" and see the : performance difference.
| n**********l 发帖数: 271 | 6 What the OS and HTTP server?
Have you tried localhost and computer name?
If you capture traffic do you see significant difference in tcp response
time?
First thing came into my mind is storage I/O and caching related issues, but
it doesn't sound like the case here.
Can you replicate this problem with other HTTP clients? I don't know how C#
handles network traffic.
I have never noticed this issue with IIS6/7 and any HTTP browser |
|