When we are conducting performance tests on web servers accessed by users across the globe, we cannot overlook the effects of latency on web response times. Consider a scenario where a web server is located in San Francisco and is being accessed by users in both San Francisco and Singapore. For users in San Francisco the round trip time from their machine to the web server will be negligible. However, for users in Singapore the round trip time will be significant and could introduce a delay of about 200 milliseconds (0.2 seconds).
HTTP uses TCP to transmit data to and from the web server. The TCP protocol requires a ‘handshake’ between the sender and the receiver. The TCP window size is the maximum amount of data that can be transferred without a confirmation. TCP windowing will limit throughput. Therefore, the total bandwidth of the network will not always be utilized.
Some Windows operating systems have a TCP Window Size of 64 KB. In this case a 200 millisecond latency would create a limit on the maximum effective bandwidth. This limit would roughly equal,
Maximum Effective Bandwidth = 64/0.2 = 320 KB per second.
This equals 320 KB/sec x 8 (bits per byte) to 2560 kilobits per second or 2.56 Mbps. The users in Singapore, even if they are connected to the internet at a higher bandwidth, say 10 Mbps, they will be communicating with the server in San Francisco at a significantly lower effective bandwidth. Having said all this, it is also true that many browsers use parallel TCP connections and that can overcome some of this limitation. However the parallel TCP connection technique has its limitations since it increases error rates and therefore can only enhance the effective bandwidth to a limited degree.
Why is there a latency, you might ask. The simple answer is that there is a limitation introduced by the finite speed of light. No matter how efficient anything else becomes, the speed of light will introduce a significant delay in the transmission of data across the globe. This will become more evident as we increase available internet bandwidth around the world.
As performance testers, we need to take latency into account when designing and interpreting the results of performance tests. This is particularly important for websites that have users spread around the globe.