๐ Bottleneck Hunting ยท Days 19โ24
Day 24: Network & Latency
Objective
Add latency or bandwidth limits and observe the impact.
Scenario
Use network throttling (tool-level or OS-level) to add 100ms or 500ms latency. Observe how throughput drops and timeout rates change.
Metrics to Watch
When It Clicks
Latency, not bandwidth, usually dominates user-perceived speed.
Solution
On Linux use `tc` to add artificial latency: `sudo tc qdisc add dev eth0 root netem delay 100ms`. On Windows use Clumsy or Windows Traffic Shaping. Run the same script with 0ms, 100ms, 500ms added RTT. Throughput drops approximately as: T = concurrency / (base_latency + added_latency). Remove latency with `sudo tc qdisc del dev eth0 root`. The key insight: adding 100ms to a 50ms response doubles end-to-end time and halves throughput for a fixed-concurrency model - but for arrival-rate models, the system simply can't keep up and starts queuing.
Reflection
At what added latency did your throughput fall by 50%?
Deliverable
A latency-sensitivity test with different RTT configurations.
โ ๏ธ Never run load tests against infrastructure you do not own or have explicit written permission to test. Always use a dedicated test environment. Unauthorized load injection can cause outages, trigger legal liability, and violate terms of service.