Skip to content

Commit

Permalink
Change rate limiter token capacity setting (opensearch-project#1635)
Browse files Browse the repository at this point in the history
Signed-off-by: Sicheng Song <[email protected]>
  • Loading branch information
b4sjoo committed Nov 17, 2023
1 parent 79335ec commit a8629cf
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1112,12 +1112,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 a8629cf

Please sign in to comment.