Increase the idle check interval of the message queue to 200ms to reduce CPU usage under low load conditions (#13227)

This commit is contained in:
吴晟 Wu Sheng 2025-05-05 22:53:09 +08:00 committed by GitHub
parent 03b0351861
commit 889ae9dbe8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 6 deletions

View File

@ -14,6 +14,7 @@
* Support Flink monitoring.
* BanyanDB: Support `@ShardingKey` for Measure tags and set to TopNAggregation group tag by default.
* BanyanDB: Support cold stage data query for metrics/traces/logs.
* Increase the idle check interval of the message queue to 200ms to reduce CPU usage under low load conditions.
#### UI

View File

@ -73,7 +73,7 @@ public class MetricsAggregateWorker extends AbstractWorker<Metrics> {
"MetricsAggregateWorker." + modelName, name, queueChannelSize, queueBufferSize, BufferStrategy.IF_POSSIBLE);
BulkConsumePool.Creator creator = new BulkConsumePool.Creator(
name, BulkConsumePool.Creator.recommendMaxSize() * 2, 20);
name, BulkConsumePool.Creator.recommendMaxSize() * 2, 200);
try {
ConsumerPoolFactory.INSTANCE.createIfAbsent(name, creator);
} catch (Exception e) {

View File

@ -127,7 +127,7 @@ public class MetricsPersistentWorker extends PersistenceWorker<Metrics> implemen
if (size == 0) {
size = 1;
}
BulkConsumePool.Creator creator = new BulkConsumePool.Creator(name, size, 20);
BulkConsumePool.Creator creator = new BulkConsumePool.Creator(name, size, 200);
try {
ConsumerPoolFactory.INSTANCE.createIfAbsent(name, creator);
} catch (Exception e) {

View File

@ -106,14 +106,14 @@ public class DataCarrier<T> {
}
/**
* set consumeDriver to this Carrier. consumer begin to run when {@link DataCarrier#produce} begin to work with 20
* set consumeDriver to this Carrier. consumer begins to run when {@link DataCarrier#produce} begin to work with 200
* millis consume cycle.
*
* @param consumerClass class of consumer
* @param num number of consumer threads
*/
public DataCarrier consume(Class<? extends IConsumer<T>> consumerClass, int num) {
return this.consume(consumerClass, num, 20, new Properties());
return this.consume(consumerClass, num, 200, new Properties());
}
/**
@ -132,14 +132,14 @@ public class DataCarrier<T> {
}
/**
* set consumeDriver to this Carrier. consumer begin to run when {@link DataCarrier#produce} begin to work with 20
* set consumeDriver to this Carrier. consumer begin to run when {@link DataCarrier#produce} begin to work with 200
* millis consume cycle.
*
* @param consumer single instance of consumer, all consumer threads will all use this instance.
* @param num number of consumer threads
*/
public DataCarrier consume(IConsumer<T> consumer, int num) {
return this.consume(consumer, num, 20);
return this.consume(consumer, num, 200);
}
/**