Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

localhost vs LAN : speed difference?

I'm currently in the process of performance profiling. We have a basic client/server application. Would the TCP transfer speed be different if I ran client/server on the same machine (localhost) vs across two computers on a LAN?

like image 352
sivabudh Avatar asked Mar 02 '10 17:03

sivabudh


People also ask

What is the speed of localhost?

So, how fast is localhost? The answer is now right in front of us — using localhost, we can transfer data at a rate of ~5 gigabytes/second!

What is meant by localhost?

Localhost is a hostname that refers to the local machine currently making the request. On many computers, localhost is an alias for the IP address 127.0. 0.1. When a computer pings this IP address, it is communicating with itself.

Is loopback fast?

Localhost "local loopback" runs as fast as your CPU, RAM, and chipset (SATA, IDE, etc.), and other local physical limits of the computer.


2 Answers

TCP transfer speed will be! because if you ran it on same computer it will forward packets locally without even touching LAN and network adapter.

But overall speed of client+server may be better on different machines, especially if you do not communicate with server too often.

like image 66
Andrey Avatar answered Sep 24 '22 08:09

Andrey


When using localhost, local resources are more likely to be the performance bottleneck because of memory, disk, cpu, etc. When using two computers, its more likely the network will be the bottleneck because of latency, bandwidth, throughput, packet loss, etc.

It depends on what your application does and how it uses the network, client, and server.

like image 29
Richard Levasseur Avatar answered Sep 20 '22 08:09

Richard Levasseur