Skip to content

CPU spikes upon broker replacement #2400

Closed
@antonakospanos

Description

@antonakospanos

Hello @dpkp @wbarnha,

We have used kafka-python to interact with our Kafka brokers since 2020.

However, during the last Kafka Broker upgrades (i.e. 3.3 => 3.5) we experienced spikes in the CPU utilization of the broker's nodes. The same happens upon hardware failure in the kafka cluster that results in replacing a broker with another node.
production

The issue is mitigated by restarting the consumers in our python apps. Aiven responded that this is a known issue on apps relying on kafka-python and we should switch to https://github.com/confluentinc/confluent-kafka-python.

Here is their whole response:

We also noticed that the impacted consumers are those based on client library kafka-python-2.0.2 , which one was last updated 3 years ago, and is based on an older version of Kafka protocol. In Kafka 3.3.1, we are aware that this older protocol has lost in efficiency, why generally leads to more latency and consumer rebalances. The short-term solution is to relax your configurations as follow:

The long term solution is to migrate these consumers to client library confuent-kafka-python-2.2.0 which one offers a similar SDK, and is up-to-date.

Is there any development in progress so that we tackle this issue?

If not we will have to switch to another kafka library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions