fix: increase ClickHouse pool size and reduce flush interval
Pool was hardcoded to 10 connections serving 7 concurrent write streams + UI reads, causing "too many simultaneous queries" and WriteBuffer overflow. Pool now defaults to 50 (configurable via clickhouse.pool-size), flush interval reduced from 1000ms to 500ms. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -39,7 +39,9 @@ public class ClickHouseConfig {
|
||||
ds.setJdbcUrl(props.getUrl());
|
||||
ds.setUsername(props.getUsername());
|
||||
ds.setPassword(props.getPassword());
|
||||
ds.setMaximumPoolSize(10);
|
||||
ds.setMaximumPoolSize(props.getPoolSize());
|
||||
ds.setMinimumIdle(5);
|
||||
ds.setConnectionTimeout(5000);
|
||||
ds.setPoolName("clickhouse-pool");
|
||||
return ds;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ public class ClickHouseProperties {
|
||||
private String url = "jdbc:clickhouse://localhost:8123/cameleer";
|
||||
private String username = "default";
|
||||
private String password = "";
|
||||
private int poolSize = 50;
|
||||
|
||||
public String getUrl() { return url; }
|
||||
public void setUrl(String url) { this.url = url; }
|
||||
@@ -17,4 +18,7 @@ public class ClickHouseProperties {
|
||||
|
||||
public String getPassword() { return password; }
|
||||
public void setPassword(String password) { this.password = password; }
|
||||
|
||||
public int getPoolSize() { return poolSize; }
|
||||
public void setPoolSize(int poolSize) { this.poolSize = poolSize; }
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ agent-registry:
|
||||
ingestion:
|
||||
buffer-capacity: 50000
|
||||
batch-size: 5000
|
||||
flush-interval-ms: 1000
|
||||
flush-interval-ms: 500
|
||||
|
||||
cameleer:
|
||||
body-size-limit: ${CAMELEER_BODY_SIZE_LIMIT:16384}
|
||||
|
||||
Reference in New Issue
Block a user