fix: increase ClickHouse pool size and reduce flush interval
All checks were successful
CI / build (push) Successful in 1m49s
CI / cleanup-branch (push) Has been skipped
CI / docker (push) Successful in 2m10s
CI / deploy-feature (push) Has been skipped
CI / deploy (push) Successful in 43s

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:
hsiegeln
2026-04-02 22:11:15 +02:00
parent 45eab761b7
commit e495b80432
3 changed files with 8 additions and 2 deletions

View File

@@ -39,7 +39,9 @@ public class ClickHouseConfig {
ds.setJdbcUrl(props.getUrl()); ds.setJdbcUrl(props.getUrl());
ds.setUsername(props.getUsername()); ds.setUsername(props.getUsername());
ds.setPassword(props.getPassword()); ds.setPassword(props.getPassword());
ds.setMaximumPoolSize(10); ds.setMaximumPoolSize(props.getPoolSize());
ds.setMinimumIdle(5);
ds.setConnectionTimeout(5000);
ds.setPoolName("clickhouse-pool"); ds.setPoolName("clickhouse-pool");
return ds; return ds;
} }

View File

@@ -8,6 +8,7 @@ public class ClickHouseProperties {
private String url = "jdbc:clickhouse://localhost:8123/cameleer"; private String url = "jdbc:clickhouse://localhost:8123/cameleer";
private String username = "default"; private String username = "default";
private String password = ""; private String password = "";
private int poolSize = 50;
public String getUrl() { return url; } public String getUrl() { return url; }
public void setUrl(String url) { this.url = url; } public void setUrl(String url) { this.url = url; }
@@ -17,4 +18,7 @@ public class ClickHouseProperties {
public String getPassword() { return password; } public String getPassword() { return password; }
public void setPassword(String password) { this.password = password; } public void setPassword(String password) { this.password = password; }
public int getPoolSize() { return poolSize; }
public void setPoolSize(int poolSize) { this.poolSize = poolSize; }
} }

View File

@@ -35,7 +35,7 @@ agent-registry:
ingestion: ingestion:
buffer-capacity: 50000 buffer-capacity: 50000
batch-size: 5000 batch-size: 5000
flush-interval-ms: 1000 flush-interval-ms: 500
cameleer: cameleer:
body-size-limit: ${CAMELEER_BODY_SIZE_LIMIT:16384} body-size-limit: ${CAMELEER_BODY_SIZE_LIMIT:16384}