You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The run will start one producer and will use the `stream-1` producer reference (default stream is `stream` and the number of the producer is 1.)
467
468
469
+
[[performance-tool-sac]]
470
+
===== Single Active Consumer
471
+
472
+
If the `--single-active-consumer` flag is set, the performance tool will create <<api.adoc#single-active-consumer, single active consumer>> instances.
473
+
This means that if there are more consumers than streams, there will be only one active consumer at a time on a stream, _if they share the same name_.
474
+
Note <<performance-tool-offset-tracking, offset tracking>> gets enabled automatically if it's not with `--single-active-consumer` (using 10,000 for `--store-every`).
475
+
Let's see a couple of examples.
476
+
477
+
In the following command we have 1 producer publishing to 1 stream and 3 consumers on this stream.
478
+
As `--single-active-consumer` is used, only one of these consumers will be active at a time.
Note we use a fixed value for the consumer names: if they don't have the same name, the broker will not consider them as a group of consumers, so they will all get messages, like regular consumers.
486
+
487
+
In the following example we have 2 producers for 2 streams and 6 consumers overall (3 for each stream).
488
+
Note the consumers have the same name on their streams with the use of `--consumer-names my-app-%s`, as `%s` is a <<consumer-names, placeholder for the stream name>>.
The performance tool has a `--super-streams` flag to enable <<super-streams.adoc#super-streams, super streams>> on the publisher and consumer sides.
499
+
This support is meant to be used with the <<performance-tool-sac, `--single-active-consumer` flag>>, to <<super-streams.adoc#super-stream-sac, benefit from both features>>.
500
+
We recommend reading the appropriate sections of the documentation to understand the semantics of the flags before using them.
501
+
Let's see some examples.
502
+
503
+
The example below creates 1 producer and 3 consumers on the default `stream`, which is now a _super stream_ because of the `--super-streams` flag:
The performance tool creates 3 individual streams by default, they are the partitions of the super stream.
511
+
They are named `stream-0`, `stream-1`, and `stream-2`, after the name of the super stream, `stream`.
512
+
The producer will publish to each of them, using a <<super-streams.adoc#super-stream-producer, hash-based routing strategy>>.
513
+
514
+
A consumer is _composite_ with `--super-streams`: it creates a consumer instance for each partition.
515
+
This is 9 consumer instances overall – 3 composite consumers and 3 partitions – spread evenly across the partitions, but with only one active at a time on a given stream.
516
+
517
+
Note we use a fixed consumer name so that the broker considers the consumers belong to the same group and enforce the single active consumer behavior.
518
+
519
+
The next example is more convoluted.
520
+
We are going to work with 2 super streams (`--stream-count 2` and `--super-streams`).
521
+
Each super stream will have 5 partitions (`--super-stream-partitions 5`), so this is 10 streams overall (`stream-1-0` to `stream-1-4` and `stream-2-0` to `stream-2-4`).
We see also that each super stream has 1 producer (`--producers 2`) and 3 consumers (`--consumers 6`).
532
+
The composite consumers will spread their consumer instances across the partitions.
533
+
Each partition will have 3 consumers but only 1 active at a time with `--single-active-consumer` and `--consumer-names my-app-%s` (the consumers on a given stream have the same name, so the broker make sure only one consumes at a time).
534
+
535
+
536
+
468
537
===== Monitoring
469
538
470
539
The tool can expose some runtime information on HTTP.
0 commit comments