Understanding, Analyzing & Reducing Latency

February 20, 2014 by iWeb Technologies in: Web Hosting Articles

In a previous post that explored where to locate your servers, one of the most important considerations was the latency (delay) between your servers and your principal markets. For a given website or application, this is most greatly influenced by the geographic distance and the quality of networking between your servers and your users.

It’s important to note that optimizing your websites and applications themselves has an enormous effect on the latency experienced by the user. However hosting infrastructure decisions and server configuration can also dramatically reduce latency without the need to compromise website design or application features.

Following the launch of our new data center locations, and with CDN on the way, this blog post looks at what causes latency, whether you should invest in reducing it, and what you can do today to reduce server latency and speed up content delivery.

Understanding latency

No matter where you host your servers, there is some degree of latency between your servers and your users, as information is passed via switches, between networks and along global fiber optic routes at the speed of light.

Latency should not be confused with bandwidth. Although bandwidth does affect internet speeds, a high bandwidth/high latency connection will achieve high throughput (data transfer rate), but with a delay before the data arrives, due to the high latency. It’s like a televised satellite interview, where latency is clearly visible in the delay between the question and answer.

When we talk about latency in hosting, we are dealing in fractions of a second. Perhaps 10-500 milliseconds when loading a web page. Whether this seems like a long delay to you is relative. It all depends on how your service is used, by whom, and how much those milliseconds are worth.

Typical levels of latency are a reality of hosting, and are not necessarily a problem for your services. However for some services, minimizing latency is mission critical.

To help understand the value of reducing latency, here are some extreme examples. In 2010 Google spent $1.9bn on a data center in downtown New York, where real estate prices are amongst the highest in the world, because it gave them direct access to local and global networks. Stock trading companies pay thousands of dollars to have information seconds in advance of competitors, and are funding a $400m project to shave 5ms off latency between New York and London. To stock market trading algorithms, having an edge in latency can mean billions of dollars.

In e-commerce, this case study by a glasses retailer found that a one second delay in page load speed caused a 7% loss in conversions, while a 2008 study by amazon showed that a 100ms increase in latency cost the retail giant 1% in sales. According to research by Akamai, a one second delay in page load speed causes an average 7% drop in conversion, 11% drop in page views and 16% drop in customer satisfaction.

Analyzing latency

Analyzing latency involves understanding the latency that exists in your infrastructure and applications, what levels of latency you can achieve, and the economics behind any decisions you make.

What constitutes high website latency?

According to Akamai, 47 percent of consumers expect a website to load in two seconds or less, and 40 percent of consumers will abandon a website that takes more than three seconds to load, suggesting that 2 seconds is the benchmark under which you should aim to keep your page load speeds. In a 2012 analysis of Google Analytics data, Google found that the web’s median page load speed is 2.7 seconds (4.8 seconds for mobile).

Page load speed can be broken down into smaller elements, most of which are addressed by optimizing website content, and the rest addressed on the server and network side. Tools like YSlow let you analyze and improve each element of your page load. In the case of YSlow based on Yahoo’s set of rules for high performance web pages.

yslow screenshot

Network and infrastructure latency

Analyzing latency due to networking and server location can be achieved by performing a traceroute from to your server. You can also perform a traceroute between your website and a variety of worldwide nodes at gomeznetworks.com – useful when you are not in the same location as your users.

If you use a hosting provider with a range of data centers and/or network options, they should be able to help you determine your network and latency options and optimize your server set up. This is covered in more detail below.

How much is latency worth to you?

By speaking to your users, performing speed tests and benchmarking versus competitors you can better understand what speed means to the success of your applications and business. To go a step further, analyzing responses to improvements in latency and attributing a value to this user behaviour can provide you with a quantitative model to understand the value of latency.

As a jumping off point, you may want to consider analyzing, testing or reducing latency if any of the following apply to you:

  • You analyzed network latency and it appears abnormally high (you may have a problem)
  • Latency is critical to the value, advantage or functionality of your application
  • Your users have access to, are accustomed to, and value high internet speeds
  • You deliver bandwidth intensive, streaming media or VOIP services (you could reduce lag)
  • Your users are geographically concentrated (you can optimize latency for these users)
  • Data needs to be quickly aggregated and processed: ‘Big Data’ / real-time analysis
  • Mobile is crucial to your website or application (latency in mobile networks is higher)
  • You deal with very high volumes of transactions (a -/+ 1% end result may be worth more)

Reducing latency

Website content

Decisions between website features and pageload speed can be tricky. A well-known Google study showed that although Google users wanted more results per page, the additional 0.4 seconds needed to increase the results per page from 10 to 30 caused caused a 25% drop off in use. Responsive design, which allows designers to optimize usability by device, can also add valuable time to page load speeds, as described in this infographic.

Not all best practices require a compromise. Two good resources for to identify best practices are Yahoo! Best Practices for Websites and this simplified guide on moz.com.

Server, location & CDN

Some of these best practices take place within your server configurations, as opposed to within your website content. From Yahoo!’s best practices, those performed on the server side include:

  • Add Expires or Cache-Control Header
  • Gzip Components
  • Configure ETags
  • Flush Buffer Early
  • Use GET for Ajax Requests
  • Avoid Empty Image src

Once your caching, scripting and configurations have been optimized, the next step is to ensure that your server has sufficient CPU and memory to serve your users. Check and benchmark your CPU and RAM usage, and consider scaling your cloud server or upgrading your dedicated server should a bottleneck be occurring, or be a risk should your traffic spike. Ask your hosting provider for help if you need to.

Next comes the infrastructure level, where you can look at data center location, and (for websites) content delivery via a CDN.

If you host your own servers on-premises, a decision to move your servers may require switching to an IaaS (hosting) or colocation provider, the larger and more advanced of which offer a range of data center locations. iWeb now offers low-latency local hosting from our data centers in Santa Clara (California), Dallas, Amsterdam, Singapore and Montreal, allowing customers to serve the Americas, Europe and Asia from regional business centers.

Tests performed on gomeznetworks showed that iWeb customers can now serve users in Sao Paulo (Brazil) from Dallas with 44% lower network latency compared to hosting in Montreal (0.994ms vs. 0.556ms), while users in Bangalore (India) would experience 73% lower network latency by moving servers from Amsterdam to Singapore (0.041ms vs. 0.153ms). Please note that these tests are meant for illustration only. You can find out more about the new data center options here.

Content Delivery Networks (CDN)

It’s not always be possible to host right next to your users, either due to the quality of the infrastructure (also crucial to latency, as well as to the reliability of your network), or because your users are geographically spread out.

In this case, a Content Delivery Network (CDN) can dramatically speed up performance by caching static page elements such as HTML files, images or JavaScript resources, and serving them from several locations around the world.

iWeb will soon support Incapsula’s CDN, which has proved to render websites 50% faster while consuming 40%-70% less bandwidth, as content is served remotely avoiding new requests from the server. Once these services are available, you ail be able to find out more on our website.

If you liked this article, found it useful, or have your own tips or experience to share, please leave a comment!

Comments

No comments yet.