What do sending hand-written letters through snail mail and exchanging WhatsApp instant messages have in common?
In both cases, the speed of a response heavily influences the “user experience” of the communication process. If the letter or text is delivered speedily, you’re happy. Unusual delay may cause frustration.
Whether you’re waiting for a reply in the mail or a response from a server, we can conclude that the request-to-response time should be as quick as possible. In computing terms, this time duration is called “latency”. It is a critical element in deciding the user experience quality of an application or a network. Slow, “high-latency” websites cause frustration in users.
Now that you have a rough idea of what is meant by latency, let’s get into technicalities.
What Is Network Latency?
Network Latency Definition #1: One-way Latency
For simple, one-way data transmission, latency is the time it takes to receive a data packet after you have sent it.
Examples of One-way Latency:
Send an email. It will be converted into packets, routed from the server, sent across the network, and passed through several devices before reaching the destination. The duration of this journey is latency.
A ping request that gives 200 ping status (HTTP OK success)! (It implies that your request was successful in reaching the destination.)
Network Latency Definition #2: Two-way Latency
For user requests that include both a request and response, latency is the time it takes to send the user request to a server and receive the response.
Examples of Two-way Latency
There are a number of ways that we can use to measure two-way latency:
The time it takes to open a page in your browser after clicking a search result in a search engine.
The lag between giving a command in your favorite online game and getting it executed.
There are two components that we add together to calculate two-way latency — Client Latency and Server Latency.
Client latency means the delay in communication is due to the end-user. Reasons for this kind of delay could be a slow connection, old device, complex query/request, etc.
Server latency, meaning the delay in communication is due to the server.
In both the above cases, latency is measured in milliseconds and every millisecond matters.
The crux of the matter is, high latency means big trouble for your business if left unchecked. You must find out what affects latency and reduce its impact on your application.
How Does Latency Work?
Now that we have answered the question, “What does latency mean?” and explained the two types, let’s discuss how it works and how it impacts an end-user.
Consider a simple use case: you want to log in to a website. You enter the username and password. And then, you click “Login” to enter the site’s dashboard.
What happens next is:
The browser responds to the click and sends your username and password to the server.
The server acknowledges the request after receiving data packets. [Here, the one-way trip completes. So, if it were one-way latency or data latency, we would calculate latency right here.]
The server compares the input credentials to the data in the database and accepts or rejects your login request depending on correctness.
The browser receives the server’s response.
As per the response, your browser will either take you to the site’s dashboard or give an error/warning, completing the round-trip for latency cycle.
Any lag or delay in this request/response process creates latency for the user.
What Are the Causes of Network Latency?
Latency occurs due to four main factors in the request/reply cycle:
Distance between nodes is a huge factor in latency. Requests and responses must travel the physical distance between the requesting device and the server. Edge computing continues to grow in popularity for time-critical applications that need near-zero latency.
Low-latency edge computing achieves faster response times than regular cloud or on-premises servers because this technology locates distributed servers in proximity with users.
Depending upon the data transmission medium, your network’s latency will be high or low. For example, copper cables transmit the data slower than fiber optics. So, latency in networks using fiber optics will be lower and better than those using copper cables.
If your end-users are on the internet, their medium for transmitting or receiving the data will differ from yours. In this case, it won’t be in your control.
Different routers have different capabilities, and the data or request transmission speed will also vary. To lower the latency effect on the data processing, you must place or use more powerful routers in the network.
Uploading and downloading data takes more time than a simple, quick ping. Your latency will increase if you need to perform operations related to storing, searching, and fetching data. Heavy or unoptimized web pages will also cause high latency.
What is a good ping speed or latency? Good ping speed or low latency differs for applications as per their utility.
100 ms is a good ping speed for VoIP, broadband, and streaming services, but gaming applications require extremely low latency — 20-30ms. For applications that are not time-critical, a good ping speed can be up to 150ms.
It also differs from technology to technology. For 4G networks, 30ms to 100ms is a good latency.
On the other hand, good 5G latency is between 5s and 20s.
Think of a database of profiles and a real-time HD game. Which one do you think should have lower latency in a network latency test?
The gaming app, obviously! Keep reading for more on latency in games.
How to Calculate or Check Network Latency
You can calculate latency using two metrics: Round Trip Time (RTT) or Time to First Byte (TTFB). RTT is the sum of client request time and server response time, while TTFB indicates the difference in HTTP request timestamp and the timestamp when the server sent the first byte in response.
Best Practices for Monitoring and Improving Networks
Latency alone can make or break your business. Users expect websites and applications to respond quickly. If your site is slow, your customers will not use it, so performing lag tests to calculate acceptable latency is crucial.
Here are the best practices for maintaining low latency networks.
Monitoring or Testing
Use the commands and tools listed above to monitor latency in your network.
Alternatively, you may also configure networking monitoring tools like Datadog, Zabbix, and SolarWinds or hire network professionals to constantly keep track of latency issues and resolve them in time.
Can Users Fix Latency on Their End? How Do I Fix My Latency?
Client latency can cause communication delay to an extent. Users on slow connections or with a lot of cookies stored from an application on their browser can try improving their connection quality or clearing browser data.
Does Location Affect Latency?
Yes, of course. The farther the data needs to get to, the longer it takes. And some regions have a better internet connection than others. The good news is – that today, there are plenty of solutions to counter these kinds of problems.
Think of an online gaming application that you own. If it takes a full second for your game to respond to players’ requests or commands, how many users would play it?
No one will, even if your game is unique and exciting.
Games are time-critical applications — every millisecond counts. Your users (players) will be present in countries all over the world, so serving them from just a few locations is not a feasible or scalable solution. Gamers won’t settle for a laggy game performance and poor user experience. Fully-managed cloud-native services allow you to set up city-level deployments and be omnipresent globally. We also have an extensive article on what is cloud gaming.
Network Latency, Bandwidth, and Throughput
We have already answered, “what is latency in networking?” However, to improve your knowledge of network latency, here is a quick overview of three interrelated terms:
Latency is the lag or delay in receiving requested information or acknowledgment from the server after a user action or request.
Bandwidth is the width of the path on which the data packets travel in your network. Bandwidth and latency are co-related because the data transfer path width will affect the communication speed and delay.
Throughput: The amount of data transferred in a given period.
For businesses, reducing latency is the way to improve the user experience. By reducing the latency or delay, you can improve the site experience for the users. But how?
Ridge Cloud, deploying edge computing for its servers worldwide, makes the data readily available for your end-users and processes user requests at an astonishingly fast speed. Ridge’s localized and distributed computing platform — built by federating data centers from all over the world — enables developers to deploy latency-sensitive applications, such as cloud gaming, in any location. They need only to interact via a single API to deploy applications in any location and to reduce latency to a minimum.
Book a demo with Ridge and see what Ridge’s edge cloud solution and distributed PoPs can do to slash your latency and impress your users.
Frequently Asked Questions
Is high latency positive or negative?
A network with high latency means slow response times, giving a bad user experience to its end-users, so it is considered bad. For example, 200 ping (in milliseconds) is high latency and bad for time-critical applications. 20-30ms (or up to 50ms) is low latency, so it is considered good. The average latency range for most sites is between 50 and 150 ms.
Are ping and latency the same?
One-way latency means the delay in data transmission and its receipt on the destination. Ping is the signal (a tiny data packet) sent to another computer, generally to check the reachability of the destination computer. One-way latency and ping are the same.
However, two-way latency requires sending a request to the server and receiving a response. This is different from ping.
How do you get a zero ping?
Zero Ping (0 Ping) is the ideal, theoretical use case. It implies that the recipient computer/server receives the sender’s request the millisecond it is sent. However, zero ping is not physically possible due to the distance between devices, network traffic, and other reasons. So instead, you can use edge computing to achieve hyper-low latency, meaning very fast response times,in cloud computing.
Does distance affect latency?
Yes. The farther the distance between the requesting device and the server, the higher the latency will be. For example, a server 20 miles away from you will respond faster than a server 2,400 miles away.
Devices in the path, physical factors, faulty network components, traffic (congestion), and signal strength are a few factors that cause this delay.
Kenny Kleinerman, Head of Content | Ridge
As the Head of Content at Ridge, Kenny is in charge of navigating the tough subjects and bringing the Cloud down to Earth.