Make Kafka Streams thread count configurable, cap JVM heaps on Unraid

- config.yml: num.stream.threads can be set with
  KAFKA_STREAMS_NUM_THREADS (default unchanged: 1). Map processing was
  bottlenecked on a single stream thread while the host was mostly idle.
- Unraid example: run 3 stream threads (topics have 3 partitions), and
  cap each JVM's heap via JAVA_OPTS. Without a cap each JVM defaults to
  1/4 of the host's RAM, and the stack grew to ~14 GB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lazzexus 2026-10-12 19:21:22 +02:00
parent ce50d9f1bb
commit 5ad3e6f27b
2 changed files with 7 additions and 1 deletions

View file

@ -17,7 +17,7 @@ kafka-streams-config:
application.id: kafkatorio-events-processor
bootstrap.servers: ${KAFKA_BOOTSTRAP_SERVERS:-localhost:9092}
state.dir: ${KAFKA_STREAMS_STATE_DIR:-.state/kafka}
num.stream.threads: 1
num.stream.threads: ${KAFKA_STREAMS_NUM_THREADS:-1}
processing.guarantee: exactly_once_v2
auto.offset.reset: earliest
default.key.serde: org.apache.kafka.common.serialization.Serdes$StringSerde