For the complete documentation index, see llms.txt. This page is also available as Markdown.

Horizontal scaling

Run multiple instances for higher throughput.

Kafka distributes partitions across consumer group members — one instance cannot read faster than its assigned partitions allow. When production on the source Kafka cluster outpaces a single replicator, therefore, we run multiple instances that share the same pipeline and consumer group.

For the replicator, Kafka assigns source topic partitions across instances in the K2K group. Kafka caps how many instances can do useful work: extra instances sit idle when every partition is already assigned. Depending on the consumer partition.assignment.strategy, the cap is either the highest partition count among subscribed source topics (range assignor) or the total partition count across those topics (round-robin and cooperative sticky assignors).

The offset mapper scales differently: Kafka assigns partitions of the internal offset mapping topic (offsetMapping.topic, default __k2k_offset_mappings) across offset mapper instances in their target Kafka cluster consumer group. Increase that topic's partition count to add parallel capacity — see Topic creation.

See Exactly once delivery and Commit tuning. For per-instance tuning, see the Advanced section below.

Prerequisites

How it works

Replicator

Start multiple replicator processes with the same pipeline configuration. Each instance uses the same source.kafka.consumer."group.id" and joins the same K2K group.

Kafka assigns each source topic partition to one group member. Each instance reads from the partitions assigned to it. Adding instances beyond the partition cap configured by the assignor does not increase throughput.

Offset mapper

Start multiple offset mapper processes with the same pipeline configuration. Each instance joins the target Kafka cluster consumer group (target.kafka.consumer."group.id" — required for the offset mapper, and shared by every instance of the pipeline) and reads from partitions of the offset mapping topic assigned to it. Offset mapper instances load mappings from their assigned partitions and apply translations for all monitored consumer groups. Parallel capacity is therefore bounded by the partition count of offsetMapping.topic on the target Kafka cluster, not by source topic partitions. Configure it under topicCreation.control.offsetMapping or topicCreation.control.common — see Topic creation.

Example

Use the same pipeline file on every instance:

Deploy one process per host, container, or pod. No additional configuration is required beyond a standard pipeline definition.

Advanced

Per-instance throughput

Higher pipelineParallelism increases concurrent partition processing but uses more memory. maxPrefetchBatches controls how far ahead each partition reads while earlier batches are still processing. For consumer, producer, and commit tuning, see Replication performance tuning.

Key
Description
Required
Default
Used by

configuration.pipelineParallelism

Max concurrent streams processing assigned partitions

No

15

Replicator

configuration.maxPrefetchBatches

Record batches prefetched per partition while earlier batches process (minimum effective value 2)

No

3

Replicator

configuration.pollInterval

Minimum interval between Kafka consumer poll calls

No

0 milliseconds

Replicator

configuration.controlParallelism

Max concurrent streams processing control messages

No

10

Replicator

Last updated

Was this helpful?