Skip to content

Commit bc63e6b

Browse files
authored
perf(s3stream/limiter): decrease the max tokens of network limiters (#2077)
Signed-off-by: Ning Yu <[email protected]>
1 parent 794f995 commit bc63e6b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/src/main/scala/kafka/log/stream/s3/DefaultS3Client.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,12 @@ public void start() {
106106
throw new IllegalArgumentException(String.format("refillToken must be greater than 0, bandwidth: %d, refill period: %dms",
107107
config.networkBaselineBandwidth(), config.refillPeriodMs()));
108108
}
109+
long maxToken = refillToken * 10;
109110
GlobalNetworkBandwidthLimiters.instance().setup(AsyncNetworkBandwidthLimiter.Type.INBOUND,
110-
refillToken, config.refillPeriodMs(), config.networkBaselineBandwidth());
111+
refillToken, config.refillPeriodMs(), maxToken);
111112
networkInboundLimiter = GlobalNetworkBandwidthLimiters.instance().get(AsyncNetworkBandwidthLimiter.Type.INBOUND);
112113
GlobalNetworkBandwidthLimiters.instance().setup(AsyncNetworkBandwidthLimiter.Type.OUTBOUND,
113-
refillToken, config.refillPeriodMs(), config.networkBaselineBandwidth());
114+
refillToken, config.refillPeriodMs(), maxToken);
114115
networkOutboundLimiter = GlobalNetworkBandwidthLimiters.instance().get(AsyncNetworkBandwidthLimiter.Type.OUTBOUND);
115116
ObjectStorage objectStorage = ObjectStorageFactory.instance().builder(dataBucket).tagging(config.objectTagging())
116117
.inboundLimiter(networkInboundLimiter).outboundLimiter(networkOutboundLimiter).readWriteIsolate(true)

0 commit comments

Comments
 (0)