Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

This page is meant as a template for writing a KIP. To create a KIP choose Tools->Copy on this page and modify with your content and replace the heading with the next KIP number and a description of your issue. Replace anything in italics with your own description.

Status

Current state:  [One of " Under Discussion", "Accepted", "Rejected"]

Discussion thread: : https://lists.apache.org/thread/fvog79tprhk4qybyfs1c0yk0v9j0wffhhere [Change the link from the KIP proposal email archive to your own email thread]

JIRA:

Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyKAFKA-16810
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

The kafka-consumer-perf-test  tool is a great tool to for quickly check assessing raw consumer performance. Currently, It it subscribes to all the partitions and gives overall cluster performance, however If we want to test performance of single broker/partition, existing tool does not support. Single partition performance test is helpful in debugging and capacity/resource estimates.provides an overview of the entire cluster's performance. However, the tool does not support testing the performance of a single broker or partition. Introducing this capability would be highly beneficial for debugging and estimating capacity and resource requirements.

In a real-world scenario, our production environment encountered an issue where a Spark Structured Streaming consumer was experiencing lag. This lag was due to some tasks taking longer to complete. Despite all tasks reading from different partitions with an equal number of records to process, the fetch-time for some partitions was noticeably higher than for others. By modifying the For example, In one of the troubleshooting scenario on production we observed that our Spark Structured Streaming consumer was lagging because some of the tasks were taking longer. We observed that all tasks were reading from different partitions and amount of records to process were equal. However, fetch-time for some of the partitions were higher than the others. With modified kafka-consumer-perf-test tool to test individual partitions, we were able to confirm isolate the same and we narrowed down problem to a single broker having with a faulty switch. 

This modification allowed provided the Hardware team to easily perform with a straightforward method to conduct experiments and verify the resolutionresolutions, ultimately streamlining the troubleshooting process and ensuring smoother operations.

Public Interfaces

Briefly list any new interfaces that will be introduced as part of this proposal or any existing interfaces that will be removed or changed. The purpose of this section is to concisely call out the public contract that will come along with this feature.

A public interface is any change to the following:

  • Binary log format

  • The network protocol and api behavior

  • Any class in the public packages under clientsConfiguration, especially client configuration

    • org/apache/kafka/common/serialization

    • org/apache/kafka/common

    • org/apache/kafka/common/errors

    • org/apache/kafka/clients/producer

    • org/apache/kafka/clients/consumer (eventually, once stable)

  • Monitoring

  • Command line tools and arguments

  • Anything else that will likely break existing users in some way when they upgrade

Proposed Changes

Add following new optional parameters to kafka-consumer-perf-test:

  • partitions
    List of partitions to fetch data from. Multiple partitions can be provided as a comma-separated list. e.g. --partitions 0,1,2
  • offsets
    List of offsets to start reading from. If specified, the list must have the same number of elements as the partitions list in the same sequence. If not specified, starts reading from earliest unless --from-latest is specified. Only works with --partitions option.

Proposed Changes

As mentioned earlier, two new flags are introduced. When they are specified, consumer will be assigned only specified partitions and seek to provided offsets (If specified). User can specify start offsets to ensure the results are precisely comparableDescribe the new thing you want to do in appropriate detail. This may be fairly extensive and have large subsections of its own. Or it may be a few sentences. Use judgement based on the scope of the change.

Compatibility, Deprecation, and Migration Plan

  • What impact (if any) will there be on existing users?
  • If we are changing behavior how will we phase out the older behavior?
  • If we need special migration tools, describe them here.
  • When will we remove the existing behavior?

Test Plan

Describe in few sentences how the KIP will be tested. We are mostly interested in system tests (since unit-tests are specific to implementation details). How will we know that the implementation works as expected? How will we know nothing broke?

Rejected Alternatives

  • This change is backward compatible since both parameters are optional

Test Plan

The change can be easily tested by specifying new parameters and checking metrics. 

Rejected Alternatives

NAIf there are alternative ways of accomplishing the same thing, what were they? The purpose of this section is to motivate why the design is the way it is and not some other way.