Latency vs. Throughput Flashcards
(14 cards)
What is latency?
The delay or time it takes a request to complete (from start to finish).
What are two characteristics of latency (measurement, as an indicator)?
It’s generally measured in time, typically seconds or milliseconds and low-latency can typically be indicative of a reliable system.
Why is latency important?
Latency becomes more important in real-time or near real-time systems. Online gaming, financial trading, and video conferencing are all examples of systems where latency matters.
What’s an example of latency?
Clicking on a link and being presented with the associated content immediately (latency would be how long it would take the content to appear).
What is throughput?
The amount of traffic sent in a system over a period of time. It’s a measure of how much work or processing a system is doing.
What are two characteristics of throughput (measurement, as an indicator)?
Throughput is measured in units of data over time (e.g. Mb/second, etc.) and higher throughput generally indicates a higher processing capacity.
Why is throughput important?
Throughput is critical in large-scale systems that work with significant amounts of data to ensure the system can function. Systems like backup, or video streaming generally require high throughput.
What’s a real-world example of the impact of throughput?
The rate of a user streaming video to their device.
How does the focus differ from latency to throughput?
Latency focuses on speed whereas throughput focuses on volume and capacity.
How does latency affect user experience? What about throughput?
High-latency can make an experience feel sluggish, likewise when throughput is low, it can have the same effect.
How does the relationship of latency go hand-in-hand with throughput in systems?
Typically they can be at odds with each other (e.g. increasing throughput may also introduce higher latency).
What are some common ways to improve latency?
- CDNs (reduce geographic distance)
- Caching
- Hardware/Resources
- Better Protocols (HTTP/2 etc.)
- DB Optimization
- Load Balancing
- Code Optimization
- Reduce External Calls
What are some common ways to improve throughput?
- Horizontal Scaling
- Caching
- Parallelization
- Batching
- DB Optimization
- Asynchronous Processing
- Network Bandwidth
When would you choose latency over throughput? And vice-versa?
Latency would be preferred in real-time system where instant feedback matters, similarly throughput would be more important in systems working with significant volumes of data.