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

GlobalDots
5 Min read

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).

Reduce your AWS costs by over 50%

Discover your Cloud Saving Potential – Answer just 5 simple questions. AppsFlyer, Playtika, Lufthansa, IBM, top leading companies are already using our FinOps services.

Reduce your AWS costs 
by over 50%

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

Cut Big Data Costs by 23%: 7 Key Practices

In this webinar, we reveal a solution that cuts big data costs by 23% and enhances system efficiency - without changing a single line of code. We’ll also explore 7 key practices that will free your engineers to process and analyze data at the pace and scale they need - and ensure they never lose control of the process.

Developer AXE-WEB
15th April, 2024
Project FOCUS: A New Age of FinOps Visibility

It’s easy for managers and team leaders to get caught up in the cultural scrum of FinOps. Hobbling many FinOps projects, however, is a lack of on-the-ground support for the DevOps teams that are having to drive this widespread change – this is how all too many FinOps projects become abandoned on the meeting room […]

Nesh (Steven Puddephatt) Senior Solutions Engineer @ GlobalDots
27th March, 2024
Optimize Your Cloud Spend with a FinOps Maturity Assessment

Achieving FinOps is a tall order: it demands a degree of organizational self-awareness that some companies are constantly battling for. Consider the predicament that many teams find themselves in: while their cloud environments may contain a number of small things that could be optimized, there are no single glaring mistakes that are consuming massive quantities […]

Nesh (Steven Puddephatt) Senior Solutions Engineer @ GlobalDots
27th March, 2024

Unlock Your Cloud Potential

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

Unlock Your Cloud Potential