Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[server] Add global bandwidth throttler into adaptive throttler #1450

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ public IngestionThrottler(
AdaptiveThrottlerSignalService adaptiveThrottlerSignalService) {
VeniceAdaptiveIngestionThrottler globalRecordAdaptiveIngestionThrottler;
EventThrottler globalRecordThrottler;
EventThrottler globalBandwidthThrottler;
VeniceAdaptiveIngestionThrottler globalBandwidthAdaptiveIngestionThrottler;

if (serverConfig.isAdaptiveThrottlerEnabled()) {
globalRecordThrottler = null;
globalRecordAdaptiveIngestionThrottler = new VeniceAdaptiveIngestionThrottler(
Expand All @@ -73,6 +76,15 @@ public IngestionThrottler(
globalRecordAdaptiveIngestionThrottler
.registerLimiterSignal(adaptiveThrottlerSignalService::isSingleGetLatencySignalActive);
adaptiveThrottlerSignalService.registerThrottler(globalRecordAdaptiveIngestionThrottler);
globalBandwidthThrottler = null;
globalBandwidthAdaptiveIngestionThrottler = new VeniceAdaptiveIngestionThrottler(
serverConfig.getAdaptiveThrottlerSignalIdleThreshold(),
serverConfig.getKafkaFetchQuotaBytesPerSecond(),
serverConfig.getKafkaFetchQuotaTimeWindow(),
"kafka_consumption_bandwidth");
globalBandwidthAdaptiveIngestionThrottler
.registerLimiterSignal(adaptiveThrottlerSignalService::isSingleGetLatencySignalActive);
adaptiveThrottlerSignalService.registerThrottler(globalBandwidthAdaptiveIngestionThrottler);
} else {
globalRecordAdaptiveIngestionThrottler = null;
globalRecordThrottler = new EventThrottler(
Expand All @@ -81,13 +93,14 @@ public IngestionThrottler(
"kafka_consumption_records_count",
false,
EventThrottler.BLOCK_STRATEGY);
globalBandwidthAdaptiveIngestionThrottler = null;
globalBandwidthThrottler = new EventThrottler(
serverConfig.getKafkaFetchQuotaBytesPerSecond(),
serverConfig.getKafkaFetchQuotaTimeWindow(),
"kafka_consumption_bandwidth",
false,
EventThrottler.BLOCK_STRATEGY);
}
EventThrottler globalBandwidthThrottler = new EventThrottler(
serverConfig.getKafkaFetchQuotaBytesPerSecond(),
serverConfig.getKafkaFetchQuotaTimeWindow(),
"kafka_consumption_bandwidth",
false,
EventThrottler.BLOCK_STRATEGY);
this.poolTypeRecordThrottlerMap = new VeniceConcurrentHashMap<>();
this.poolTypeRecordThrottlerMap.put(
ConsumerPoolType.AA_WC_LEADER_POOL,
Expand Down Expand Up @@ -177,7 +190,9 @@ public IngestionThrottler(
this.finalRecordThrottler = serverConfig.isAdaptiveThrottlerEnabled()
? globalRecordAdaptiveIngestionThrottler
: globalRecordThrottler;
this.finalBandwidthThrottler = globalBandwidthThrottler;
this.finalBandwidthThrottler = serverConfig.isAdaptiveThrottlerEnabled()
? globalBandwidthAdaptiveIngestionThrottler
: globalBandwidthThrottler;
this.isUsingSpeedupThrottler = false;
}

Expand Down
Loading