From 4cdf2ac0127b74a97eb7edd583da36098c5588aa Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Fri, 13 Mar 2026 22:44:03 +0100 Subject: [PATCH] Fix ClickHouse OOM on batch insert: reduce batch size, increase memory Execution rows are wide (29 cols with serialized arrays/JSON), so 500 rows can exceed ClickHouse's memory limit. Reduce default batch size from 500 to 100 and bump ClickHouse memory limit from 2Gi to 4Gi. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../java/com/cameleer3/server/app/config/IngestionConfig.java | 2 +- deploy/clickhouse.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cameleer3-server-app/src/main/java/com/cameleer3/server/app/config/IngestionConfig.java b/cameleer3-server-app/src/main/java/com/cameleer3/server/app/config/IngestionConfig.java index 762b0e39..ab806e2d 100644 --- a/cameleer3-server-app/src/main/java/com/cameleer3/server/app/config/IngestionConfig.java +++ b/cameleer3-server-app/src/main/java/com/cameleer3/server/app/config/IngestionConfig.java @@ -12,7 +12,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; public class IngestionConfig { private int bufferCapacity = 50_000; - private int batchSize = 500; + private int batchSize = 100; private long flushIntervalMs = 1_000; public int getBufferCapacity() { diff --git a/deploy/clickhouse.yaml b/deploy/clickhouse.yaml index 4cbd69b6..2fe911d1 100644 --- a/deploy/clickhouse.yaml +++ b/deploy/clickhouse.yaml @@ -40,10 +40,10 @@ spec: mountPath: /var/lib/clickhouse resources: requests: - memory: "512Mi" + memory: "1Gi" cpu: "200m" limits: - memory: "2Gi" + memory: "4Gi" cpu: "1000m" livenessProbe: httpGet: