Skip to content

Commit

Permalink
Change rate limiter token capacity setting (#1635)
Browse files Browse the repository at this point in the history
Signed-off-by: Sicheng Song <[email protected]>
  • Loading branch information
b4sjoo authored Nov 15, 2023
1 parent 5ee36ab commit 13b50ea
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1124,12 +1124,13 @@ private TokenBucket rateLimiterConstructor(Integer eligibleNodeCount, MLModel ml
TimeUnit rateLimitUnit = mlModel.getRateLimitUnit();
log
.debug(
"Initializing the rate limiter for Model {}, with TPS limit {}, evenly distributed on {} nodes",
"Initializing the rate limiter for Model {}, with TPS limit {} and burst capacity {}, evenly distributed on {} nodes",
mlModel.getModelId(),
rateLimitNumber / rateLimitUnit.toSeconds(1),
rateLimitNumber,
eligibleNodeCount
);
return new TokenBucket(System::nanoTime, rateLimitNumber / rateLimitUnit.toNanos(1) / eligibleNodeCount, 2);
return new TokenBucket(System::nanoTime, rateLimitNumber / rateLimitUnit.toNanos(1) / eligibleNodeCount, rateLimitNumber);
}
return null;
}
Expand Down

0 comments on commit 13b50ea

Please sign in to comment.