Web Technology Basics
A CDN receives 2,000 requests per second, and its cache hit ratio rises from 90% to 98%. The response time is 20 ms on a hit, and 200 ms on a miss because the content is fetched from the origin server and returned; only requests that miss reach the origin server. Which of the following is the combination of the number of requests reaching the origin server and the average response time after the ratio reaches 98%?
- A40 per second, about 24 ms
- B40 per second, about 110 ms
- C160 per second, about 24 ms
Show answer and explanation
Answer: A. 40 per second, about 24 ms
The requests that miss are 100 − 98 = 2% of the total, so 2,000 × 0.02 = 40 per second reach the origin server. At 90% it was 200 per second, so a rise of just 8 points in the hit ratio cuts the origin server's load to one fifth. The average response time is 0.98 × 20 + 0.02 × 200 = 19.6 + 4 = 23.6 ms, about 24 ms. This is also much shorter than the 0.9 × 20 + 0.1 × 200 = 38 ms at 90%.
- A. Correct. 2,000 × 0.02 = 40, and 0.98 × 20 + 0.02 × 200 ≈ 24 ms.
- B. This takes the response time as the simple average of 20 ms and 200 ms, (20 + 200) ÷ 2 = 110 ms. The average must be weighted by the proportions of hits and misses.
- C. 160 is the decrease in requests reaching the origin server, 200 − 40. The number reaching it after the ratio reaches 98% is 40.