GUIDE

What is low latency? And why is latency important?

What is latency?

Latency is the delay or time it takes for data to travel from one point to another in a network.

What is low latency (ping)?

Low latency is one of the most important features of any website, program or application on a network. Customers are used to real-time results, they expect feedback instantly when they perform an action. Delays are one of the top reasons customers will quit using an application (bounce).

How do you measure latency?

Latency is measured in milliseconds (ms), and the closer to zero it can reach, the better. It's measured in various ways depending on the context, but common methods include:

  1. Ping: Sending a small packet of data from one device to another and measuring the round-trip time it takes for the packet to travel.

  2. Traceroute: Mapping the path and measuring latency at each hop between the source and destination.

  3. Application-level monitoring: Using specialized tools or built-in features to measure latency within specific applications or services.

  4. Network monitoring tools: Utilizing tools like SNMP (Simple Network Management Protocol) or packet analyzers to monitor latency across a network.

  5. Real-user monitoring (RUM): Collecting data from actual users' interactions with a website or application to measure the latency experienced in real-world scenarios.

Each method has its advantages and limitations, so the choice depends on the specific requirements and goals of the measurement.

What Causes of network latency?

Network latency specifically refers to any delay of data transmission over the internet on a network. Propagation delay is the amount of time it takes for a client to send a message to a server, also known as a ping. Round-trip time measures the amount of time it takes for the entire process—from the client sending a request to when the client receives the response from the server. Latency refers to the round-trip time.

Internet traffic management uses algorithms to decrease latency, where they measure the amount of data traveling through a network, then route accordingly and allocate sufficient bandwidth to prevent delays, like traffic bottlenecks.  

How to improve (reduce or lower) latency?

As a business, the simplest solution to reducing latency for your users is to invest in networking solutions like edge computing, clouds or data stream networks. They work by connecting the user to the closest source of information, decreasing the distance that data packets have to travel. 

Content delivery networks (CDNs) are an industry of geographically distributed servers and data centers that increase speed by providing users with more (and closer) locations of stored data at any given time. CDNs work alongside internet service providers and are commonly used for services like video streaming, loading webpages, and downloading software. The amount of data centers and their spatially distributed locations help to decrease load times and high bandwidth across networks, greatly improving quality of service on the Internet.

Real-time networks build off of CDNs and establish persistent connections between clients and servers, which allow messages to flow freely and almost instantaneously. For example, PubNub’s real-time data stream network uses multiple forms of TCP connections, like WebSockets, MQTT, and HTTP long polling APIs, to provide persistent connections and quick data transmission. This optimizes the network for extremely high speeds and low latency.

Improving latency involves optimizing various aspects of network communication and system performance. Here are some strategies to consider:

1. Use a Wired Connection: Wired connections typically offer lower latency compared to wireless connections, which can be affected by interference and signal strength.

2. Optimize Network Configuration: Ensure that your network hardware, such as routers and switches, are configured correctly and are capable of handling the desired traffic without bottlenecks.

3. Reduce Network Congestion: Minimize the number of devices sharing the network and prioritize critical traffic to reduce congestion and latency.

4. Utilize Content Delivery Networks (CDNs): CDNs distribute content across multiple servers globally, reducing the distance data needs to travel and improving latency for users accessing the content.

5. Implement Caching: Caching frequently accessed data locally can reduce the need to fetch data from distant servers, thereby improving latency.

6. Optimize Protocol Efficiency: Choose communication protocols that minimize overhead and reduce latency, such as using UDP instead of TCP for real-time applications.

7. Use Quality of Service (QoS): Implement QoS mechanisms to prioritize critical traffic over less time-sensitive data, ensuring that latency-sensitive applications receive sufficient bandwidth and resources.

8. Optimize Application Design: Design applications to minimize round trips and unnecessary data transfers, optimizing data transmission.

9. Deploy Edge Computing: Utilize edge computing resources to process data closer to the end-user, reducing the distance data needs to travel.

10. Monitor and Analyze Performance: Continuously monitor network performance and latency metrics to identify bottlenecks and areas for improvement, allowing for proactive optimization.

What is good latency in networking?

Good latency typically refers to low latency, which is measured in milliseconds (ms). Latency standards examples:

  1. For online gaming and real-time applications: Latency below 50 ms is considered excellent, 70-80 ms is good latency, while latency around 100 ms is often acceptable for most users.

  2. For video streaming and VoIP (Voice over Internet Protocol): Latency below 150 ms is usually acceptable to maintain smooth playback and conversation without noticeable delays.

  3. For web browsing and general internet usage: Latency below 100 ms is considered good, with lower values providing faster responsiveness.

These are just general guidelines, acceptable latency levels may vary.

The relationship of low latency, bandwidth, and throughput

Bandwidth, throughput, and latency have a cause-and-effect relationship, where the capacity of one affects the other. For example, lower bandwidth will increase the latency by not letting as much data travel as quickly across a network.  

What is bandwidth? 

Bandwidth is the maximum capacity of a network connection. Higher bandwidth, or more capacity, equates to lower latency.

What is throughput?

Throughput measures how much data a system can process at any given time. While latency measures the amount of time, throughput measures the amount of data that can be sent.

What causes high latency?

  1. Distance: The main cause of latency. When a server is located across the world from a client’s device, it increases the amount of milliseconds that it takes for the data packets to travel across the network. While an increase of 30-40ms may seem invisible to our naked eye, the delays are compounded because the data will usually have to travel through multiple network connection points. This is why satellite internet is slower than cable internet, because the signal has to travel wirelessly all the way to orbit and back.

  2. Network congestion. Congestion occurs when a network takes on more traffic than it can support. Usually this is when too many clients have joined a network that doesn’t have enough bandwidth to support them. This can cause delays or loss of data in messages traveling across the network.

  3. Physical barriers. A user’s internet connection can affect the latency of your application on their system. Connection type, internet service provider, and the amount of speed and bandwidth they have purchased all play a role in any latency they experience. Or for example, Ethernet is usually faster than Wi-fi, or an old router may not have sufficient bandwidth to support streaming.

Other common names for latency:

  1. Lag (slang)

  2. Ping

  3. Delay

  4. Response time

  5. Latency jitter

  6. Rubber-banding (often used in gaming contexts)

  7. Hitching (common in streaming and video applications)

  8. Buffering (specifically in media streaming)

Why low latency is essential in real-time applications

Latency can be affected by many physical barriers like internet service, internet speed, or specific IP networks. Companies and IT professionals have continuously innovated and introduced ways to improve network speeds and the general user experience.

PubNub provides a real-time data stream network that allows developers to build real-time applications with almost no latency and unlimited concurrent users. With five global data centers, latency of less than 100 milliseconds worldwide, and 99.999% uptime service level agreements, you can be confident that your application will reliably run in real time and scale to fit your needs. If you are interested in building your real-time application with PubNub, contact sales today.