Google’s Web Performance Best Practices #2: Minimize Round Trip Times (RTT)

Background

This is our second post in the series on improving your page load time according to Page Speed online tool results and according to Google’s Web Performance Best Practices document that comes with the tool, along with the rules that fall into six categories altogether (minimizing Round Trip Times being the second). Page Speed evaluates how well your pages eliminate steps involved in page load time such as transmitting HTTP requests, downloading resources, parsing and executing scripts, and resolving DNS names, and according to these results you can act to speed up a component which is slowing you down the most.

Please consult our previous blog post that deals with caching also (Best Practices for Caching).

How One AI-Driven Media Platform Cut EBS Costs for AWS ASGs by 48%

How One AI-Driven Media Platform Cut EBS Costs for AWS ASGs by 48%

Round Trip Time or RTT

Round trip time (RTT) is the time required for a signal pulse or packet to travel from a specific source such as the computer that initiates the signal, to a specific destination such as a remote computer or system, and back.

In a nutshell, RTT is the time between a request for data and the complete return or display of that data. RTT can be determined by pinging a certain address and depends on many factors such as connection source, connection medium, physical distance between the actual source and the remote system, number of nodes between them, traffic amount and the number of other requests handled by the server. The RTT can range from a few milliseconds (thousandths of a second) under ideal conditions to several seconds under adverse conditions between points separated by a large distance.

How to measure RTT

RTT is typically measured in milliseconds using the Ping command. The Ping command is a command-line tool that measures the time taken for a data packet to be sent to a specific destination and come back again to the point of origin.


For a browser to initiate a first-time connection with a web server, it must incur a minimum of 3 RTTs: 1 RTT for DNS name resolution, 1 RTT for TCP connection setup, and 1 RTT for the HTTP request and first byte of the HTTP response. Many will require dozens of RTTs which is a huge factor contributing to latency. Minimizing the number of RTTs is thus crucial for improving a page load time, even for “fast” broadband connections.

Reducing a RTT using a CDN

CDNs use a variety of methods and techniques to reduce the RTT. CDNs cache and compress webpages which are then hosted in local data centers. A CDN uses a diverse network of geographically spread Points of Presence (PoPs) represented by local data centers, which contain cached copies of website content.  

CDNs also cache media, HTML files which means that a user’s request can be addressed through a local PoP, which avoids the need for the request to travel to the main server. As content is delivered to users from servers based on the location, it helps in reducing the RTT, as the distance that a request has to travel is greatly reduced. CDNs also use compression technologies and image optimization techniques to improve the page load times for websites, which results in reduced RTT.

CDNs use load distribution techniques. During days of high traffic, CDNs have the capability to re-route service requests through alternate or backup servers which have lower network congestion. This speeds up server response time and reduces the RTT. As most CDNs use the cloud, high scalability is assured, which reduces the probability of any bottleneck due to infrastructure constraints. All the major CDNs have landmark agreements with the major ISPs to provide Tier I access to the Internet backbone. This has great significance, as it reduces the number of network hops that a request has to travel to, for reaching the destination. This has a major impact on the RTT.

Making a Long Trip Shorter

To save yourself the trouble of long round-trips, you can try reducing the number of serial round-trips by doing more in parallel and getting rid of excess weight, or reducing the round-trip-time by moving your location closer to the user, or finally, you can reduce the server time.

Google’s performance best practices suggest acting on several areas:

  • Minimizing DNS lookups
  • Minimizing redirects
  • Avoiding bad requests
  • Combining external JavaScript
  • Combining external CSS
  • Combining images using CSS sprites
  • Optimizing the order of styles and scripts
  • Avoiding the document.write() command
  • Avoiding CSS @import
  • Preferring asynchronous resources
  • Parallelizing downloads across hostnames

Reducing the number of unique hostnames from which resources are served cuts down on the number of DNS resolutions that the browser has to make. By reducing the number of HTTP redirects from one URL to another, enterprises can cut out additional RTTs and the waiting time for end users. Additionally, the number of wasteful requests can be reduced significantly by removing broken or invalid links. A further level of efficiency can be introduced by consolidating external scripts. This action can help in further reducing the RTT.  Similarly, the overall data downloaded by a webpage can be reduced by combining images into a small number of files. This can also help in reducing the number of round-trips. 

Using the document.write() command to fetch external resources early in the document, can significantly increase the time it takes to display a web page. Using CSS @import in an external stylesheet can add additional delays during the loading of a web page. This issue can be addressed by fetching resources in an asynchronous manner. Serving resources from two different hostnames increases parallelization of downloads. Visualizing the page download accurately, as it really flows, is essential to performance analysis and acting on specific areas.

For minimizing round trip time, bandwidth doesn’t matter. If bandwidth can be looked at as a diameter of a pipe through which data needs to travel, RTT can be compared to the time that data still needs to travel from one end of the pipe to the other and back (and this matters if you are in London, and your client is, for example, in Beijing). No matter how big the pipe. RTT must be handled the other way and without shortcuts, by combining the best practices mentioned above.

Implement with Experts

With over 17 years of experience, GlobalDots has an unparalleled knowledge of today’s leading web performance technologies. Our team knows exactly what a business needs to do to succeed in providing the best online presence for their end customers. We analyze your needs and challenges to provide you with a bespoke recommendation about which services you can benefit from.

GlobalDots is a world leader implementing web performance & security solutions, such as Content Delivery Networks & Multi CDN, innovative Bot Protection DDoS Protection,  Cloud performance optimization and many more.

To minimize RTT and optimize your web assets’ overall performance, reach out to us by clicking here

Latest Articles

Complying with AWS’s RI/SP Policy Update: Save More, Stress Less

Shared Reserved Instances (RIs) and Savings Plans (SPs) have been a common workaround for reducing EC2 costs, but their value has always been limited. On average, these shared pools deliver only 25% savings on On-Demand costs—far below the 60% savings achievable with automated reservation tools. For IT and DevOps teams, the trade-offs include added complexity, […]

Itay Tal Head of Cloud Services
21st November, 2024
Three Ways CISOs Can Combat Emerging Threats in 2025

73% of CISOs fear a material cyberattack in the next 12 months, with over three-quarters convinced AI is advancing too quickly for existing methods to combat it. But what can CISOs do to prepare for the coming wave – and access the resources they need to deal with this evolving threat landscape? To find out, […]

11th November, 2024
How Optimizing Kafka Can Save Costs of the Whole System

Kafka is no longer exclusively the domain of high-velocity Big Data use cases. Today, it is utilized on by workloads and companies of all sizes, supporting asynchronous communication between even small groups of microservices.  But this expanded usage has led to problems with cost creep that threaten many companies’ bottom lines. And due to the […]

Itay Tal Head of Cloud Services
29th September, 2024
Migrating Volumez RedHat VMs into Amazon Linux 2 for higher effective discounts rate of Saving Plan

A cloud data infrastructure company relied on extensive use of multiple instance types to test its products. But this made it difficult to optimize costs – a fact which had begun to impact their ability to scale the business.   The GlobalDots team helped the company identify and implement a new infrastructure configuration that both saved […]

Itay Tal Head of Cloud Services
19th September, 2024

Unlock Your Cloud Potential

Schedule a call with our experts. Discover new technology and get recommendations to improve your performance.

    GlobalDots' industry expertise proactively addressed structural inefficiencies that would have otherwise hindered our success. Their laser focus is why I would recommend them as a partner to other companies

    Marco Kaiser
    Marco Kaiser

    CTO

    Legal Services

    GlobalDots has helped us to scale up our innovative capabilities, and in significantly improving our service provided to our clients

    Antonio Ostuni
    Antonio Ostuni

    CIO

    IT Services

    It's common for 3rd parties to work with a limited number of vendors - GlobalDots and its multi-vendor approach is different. Thanks to GlobalDots vendors umbrella, the hybrid-cloud migration was exceedingly smooth

    Motti Shpirer
    Motti Shpirer

    VP of Infrastructure & Technology

    Advertising Services