Are there performance benefits of using 127.0.0.1?

0

I administrate a web application that runs on Windows IIS. Recently during an upgrade I saw the following message:

"Could not connect to webapp-01:1000"

I think that the web app and the windows service are communicating by using the ip 192.168.1.16 even though they are actually on the same server.

Is there a performance gain to be had by using the 127.0.0.1 ip for inter-process communication instead of 192.168.1.16?

                 +––––––––––+                    
                 |          | Windows IIS application
     +–––––––––––+          | webapp-01:80       
     |           |          |                    
     |           |          |                    
     |           +–––––+––––+                    
     |                 |                         
     +                 +                         
127.0.0.1        192.168.1.16                     
     +                 +                                                                 
     |                 |                         
     |           +–––––+––––+                    
     |           |          | Windows service     
     +–––––––––––+          | webapp-01:1000      
                 |          |                    
                 |          |                    
                 +––––––––––+  

If so does anyone have any suggestions for tests to test this?

Bruno

Posted 2014-04-12T11:41:50.047

Reputation: 103

My take would be that if any, they would be minimal. Even for 127.0.0.1, the IP stack must be consulted - the address isn't special other than by convention. But the loopback is probably looked up first. – Paul – 2014-04-12T11:53:58.110

Answers

1

There will be no measurable performance difference, as the data will never be send through the ethernet interface.
One disadvantage of your configuration is, that if you change the ip of the server, you will need to reconfigure the web app! If you set to localhost / 127.0.0.1 you won't have this problem.

davidbaumann

Posted 2014-04-12T11:41:50.047

Reputation: 2 089

But does the network card still need to handle the request? – Bruno – 2014-04-12T12:07:28.870

It must be connected to a network, because if it's not connected, windows won't know it's using this address. But it will be clever enough to not use the bandwidth. – davidbaumann – 2014-04-12T12:10:15.820

@Bruno No, packets for loopback addresses never make it to a network card. You don't even need a NIC for loopback to work. – Patrick Seymour – 2014-04-12T12:45:59.913

@PatrickS. I suppose my question was whether packets for the server's ip do make it onto the NIC. Probably not but just thought I would ask. – Bruno – 2014-04-12T12:54:36.343

To make sure: Set it to 10MB half-duplex and copy some files! – davidbaumann – 2014-04-13T12:36:54.117

I used iperf to test it and both were exactly the same. Thanks for your help. – Bruno – 2014-04-14T09:14:36.653