Menu

Post image 1
Post image 2
1 / 2
0

Latency vs Throughput

DEV Community·LeetDezine·26 days ago
#INNTQbQu
Reading 0:00
15s threshold

LeetDezine The first time I heard "optimize for latency," I thought it meant "make it fast." So I turned off batching, flushed writes immediately, set Kafka's linger.ms to 0. The system responded faster. And handled way less load. Latency and throughput pull in opposite directions. Making your system faster for individual requests usually means it handles fewer of them per second. Handling more per second usually means individual requests wait longer. This tradeoff shows up everywhere and misidentifying which axis to optimize is one of the most common architecture mistakes. DB Batch Writes Your database is getting hammered with writes. Each write goes to disk immediately. Latency per write: 10ms One thread handles: 100 writes per second Change the approach: collect 100 records, flush in one batch. One disk operation instead of 100. Throughput went up — the disk does the same work with 100× fewer operations. Latency went up — the first record now waits for 99 more before anything gets written.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More