How server location affects latency?

by Zain Imran  October 1, 2015

As a user of Cloud Web Hosting technology, you must be well aware of the multitude of infrastructure-as-a-service providers, as well as platform-as-a-service providers claiming that their services offer you “high-speed” hosting.

What exactly do we mean by “speed” in cloud computing terms? Speed is dependent on several factors:

  • Bandwidth of your internet connection
  • Number of other users and/or applications using the bandwidth on your local network
  • Your contention ratio
  • Distance from your local exchange.
  • Throttling / traffic shaping by your ISP
  • The load of the server you are connecting to
  • Nature of storage device on your cloud infrastructure (traditional HDD vs SSD)
  • The effectiveness of hypervisor on the host machine (Thanks to Salvatore Cordiano for pointing out this factor)

server location affects latency banner

Yet, there is another factor which is important to the performance of your websites. It is a metric which affects users in all locations, differently. It is called latency.

Read on to find out how it affects the performance of your websites, and hence, your online business.

Bandwidth vs. Latency

I am going to use the analogy of a highway to explain the difference between bandwidth and latency. After all, the internet, too, is an information highway.

Bandwidth

It is the capacity of data transfer per second. Think of it as the width of a highway. A 6-lane highway allows more cars to go past a certain point per second than a 4-lane highway. Similarly, a 1Gbps connection can transfer more data per second than a 100Mbps connection.

Latency

The latency is the time it takes for a packet of data to move from its origin to its destination. On the highway, this would be similar to a delay caused by stopping at a toll plaza or diversion. The more toll plaza queues or road closures and diversions you have to deal with, the greater the time delay in reaching your destination.

Causes of Latency

If you have the option of hosting a server on the West Coast of the USA or in Singapore, which server location should you choose? The answer is quite simple. Choose the location closest to your target audience!

When a user types in the URL of your website, their computer sends and retrieves data at the speed of light, through a route of “gateway nodes” or more simply, “hops”. These are routers with an inherent processing delay.

The further the distance is between the user and the server hosting the website, the greater the latency. The delay also depends on the networking efficiency and the quality of the routing devices.

Crunching Numbers

The speed of light in fibre optic cables is approximately 200,000 km/second. The distance between Los Angeles on the US West Coast and Singapore is 14,112 km.

Disregarding the additional delay due to “hops” (as packet routing is variable), and simply considering the delay due to the speed of light, the latency is 141 milliseconds per packet round trip! The delay due to hops will be in addition to this time.

As you can see, distance can make a significant impact on the latency delay for a user.

User experience

According to renowned computer scientist Van Jacobson, one of the inventors of the TCP/IP protocol stack, a user begins to notice latency delay at 400 ms.

Since most use-cases require frequent-back-and-forth exchanges, the above mentioned 141 ms delay can add up to much more. Even at 250 ms, the latency causes the user to feel like the website is loading slowly.

To qualify for a “blazing fast” connection, the industry standard is 10 ms or better.

Measuring Latency

To measure the latency, use the tracert command in the Windows command prompt.

To do this in Windows, click the Start button, and type “cmd” in the search bar. In the command prompt, enter tracert website.com, where website.com is replaced by the URL of the website you with to trace route.

I compared the latency difference between two websites, Yahoo! and Baidu.

Yahoo has several servers around the world. As you can see in the screenshot, the number of “hops” in the traceroute of the Yahoo URL is only ten, and the latency average is under 200ms. I traced the route to the Yahoo server nearest to me; its UK server.
Whereas Baidu, which has servers only in China, has several “hops” spanning different countries, and has a high latency average from my location.

tracert Yahoo tracert Baidu

 

The closer the better

Given these facts, I recommend you to always host your websites and applications closest to your target audience. Especially for SSH access and use cases involving frequent access of a database, the latency can be a deal breaker for a potential customer.

Make sure your business is not losing revenue because of your choice of hosting provider and server location!

Vast geographical coverage on Cloudways

The Cloudways Managed Cloud Hosting Platform offers you servers on the world’s most renowned infrastructure providers; DigitalOcean, Google, and Amazon. You can host your website on over a dozen unique locations on different continents.

The Apache-Nginx webserver, Varnish HTTP accelerator, and Memcached and optional Redis cache stack of Cloudways delivers premium quality hosting solution for your business needs.

Host your website nearest to your target audience, with 24/7/365 support from Cloudways Support Staff. Everything we do is geared to please our customers.

Launch your free trial on the Cloudways Managed Cloud Hosting Platform today.

 

Start Creating Web Apps on Managed Cloud Servers Now

Easy Web App Deployment for Agencies, Developers and E-Commerce Industry.

About Zain Imran

Zain Imran is a Digital Content Producer at Cloudways. He is an engineer and loves to learn about technologies. He is a sports and fitness freak.

Stay Connected:

You Might Also Like...