AlgoMaster Newsletter

AlgoMaster Newsletter

Share this post

AlgoMaster Newsletter
AlgoMaster Newsletter
What is Latency and How to Reduce it?
Copy link
Facebook
Email
Notes
More

What is Latency and How to Reduce it?

Ashish Pratap Singh's avatar
Ashish Pratap Singh
Dec 20, 2024
∙ Paid
100

Share this post

AlgoMaster Newsletter
AlgoMaster Newsletter
What is Latency and How to Reduce it?
Copy link
Facebook
Email
Notes
More
2
5
Share

Latency is the time between a user taking an action—like clicking a button or loading a webpage—and receiving a response from the system.

In simple terms, latency is the time delay between:

  • When a user makes a request

  • When they receive the response

Visualized using Multiplayer

Lower latency means faster responses and a better user experience.

In this article, we’ll explore the causes of high latency and how to reduce latency at different layers of your system.


📣 Design, develop and manage distributed software better (Sponsored)

Multiplayer's Platform Debugger provides deep session replays with every detail you need to find and fix a bug. From frontend screens to backend traces, metrics, and logs, all in one place. Debug faster and fix customer problems more easily, so you and your team can stay focused on building great software, not combing through APM data.

Get Started for FREE


What Causes High Latency?

  • Geographical Distance: The farther a user is from your server, the longer data takes to travel. Even though data moves close to the speed of light, crossing thousands of miles takes more time than traveling a few hundred.

  • Overloaded Servers: When a server receives more requests than it can handle, it slows down. This overload can happen due to sudden traffic spikes, inefficient resource usage, or inadequate server capacity. As servers struggle to keep up, each request takes longer to process, and latency spikes.

  • Slow Database: If your database queries take too long—due to large tables, missing indexes, or poorly written queries—responses take longer.

  • Inefficient Code Paths: Sometimes latency hides in the application’s code. Overly complex code, unnecessary calculations, and complicated logic can introduce small delays that add up.

  • Network Congestion: Heavy network traffic, limited bandwidth, and busy intermediaries between the user and your server can slow requests. Employing techniques like load balancing across different network paths, using faster protocols (like HTTP/2 or HTTP/3), and minimizing payload sizes can help reduce the impact of congestion.


How to Reduce Latency

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2025 Ashish Pratap Singh
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share

Copy link
Facebook
Email
Notes
More