Explore Library
Code QuizAdvanced

Computing Desired Serving Replicas

Spot the arithmetic that under-provisions autoscaled replicas.

Codepython
def desired_replicas(current_qps, qps_per_replica):
    replicas = current_qps // qps_per_replica
    return max(1, replicas)

# current_qps=250, qps_per_replica=100
print(desired_replicas(250, 100))  # 2

What is the bug in this autoscaling calculation?