CCAAK practice question 11 of 15

A Kafka administrator notices that their consumers of Topic X are starting to fall behind. The administrator sees that Topic X has four partitions, and the consumer group has two consumers. Which change can increase the performance of the Consumer Group?

Full set: 54 questions
Answer options
A: Increase the partitions in Topic X.
B: Create a new consumer group for Topic X containing two (2) consumers.
C: Decrease the consumer acknowledgment property to increase throughput.
D: Increase the number of consumers in the consumer group. Correct answer
Correct Answer:
D. Increase the number of consumers in the consumer group.
Explanation

The fundamental unit of parallelism for consumption in Kafka is the topic partition. A consumer group can scale its processing throughput by adding more consumer instances, up to the total number of partitions in the topic. In this scenario, the topic has four partitions, but the consumer group only has two consumers. This means each consumer is responsible for processing messages from two partitions. By increasing the number of consumers in the group to three or four, the partitions will be rebalanced across more instances, allowing the workload to be processed in parallel and increasing the overall consumption rate for the group.

Why Incorrect

A. Increase the partitions in Topic X. This alone does not help. Without adding more consumers, the existing two consumers would simply be assigned more partitions, increasing their individual load and worsening the lag.
B. Create a new consumer group for Topic X containing two (2) consumers. This creates an independent subscription to the topic. It does not improve the performance of the original consumer group that is falling behind; it only duplicates the data stream.
C. Decrease the consumer acknowledgment property to increase throughput. This is ambiguous. Producer acks affect producer durability, not consumer speed. Consumer commit frequency (auto.commit.interval.ms) is not the primary lever for scaling consumer processing power.

References

1. Narkhede, N., Shapira, G., & Palino, T. (2021). Kafka: The Definitive Guide (2nd ed.). O'Reilly Media.

Chapter 4, Consumers: Reading Data from Kafka, Section: "Consumer Groups and Partition Rebalance", p. 78: "If you add more consumers to a single group while consuming from a topic, you scale the reading and processing of messages from that topic. The new consumers will take over some of the partitions, lowering the load on the other consumers." This directly supports adding consumers to scale performance.

2. Apache Kafka Documentation (Official Vendor Documentation).

Section 3.4, Consumers: "If all the consumer instances have the same consumer group, then the records will effectively be load balanced over the consumer instances... This is how Kafka scales consumption. You can't, however, have more consumer instances than partitions." This confirms that adding consumers is the standard method for scaling.

3. Confluent Developer (Official Vendor Courseware).

Kafka 101, Module: Consumer Groups: "To increase the parallelism of your consumer group, you can add more consumers. Kafka will automatically assign the new consumer to a free partition. The maximum parallelism of a consumer group is the number of partitions in the topic being consumed." This explicitly states that adding consumers increases parallelism up to the partition count.

Scroll to Top