Skip to content

High CPU load when using Group Coordination #494

Closed
@CVTJNII

Description

@CVTJNII

Using kafka.KafkaConsumer in multiple processes with the same group ID I'm noticing high CPU load when idle. I'm running the kafka-python 0.9 branch (commit 31c3d59) against Kafka 0.9.0.0. Group coordination is working as expected, with each message being processed by one consumer in the group, however (n-1)/n consumers in the group are running at 100% CPU. With n=1 CPU load is low as expected, however with n>1 I see n-1 processes running 100% CPU as if they were busy-spinning.

I'm seeing this with the following, stripped-down consumer worker function:

def consumer_worker(kafka_uri, topic, group_id, heartbeat, stats_array):
    consumer = kafka.KafkaConsumer(topic, group_id=group_id, bootstrap_servers=[kafka_uri])
    for message in consumer:
        print "consumer_worker iterating"

The print shows that the for isn't busy-spinning. I have not performed any further profiling at this point.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions