Reputation: 80186
I have a kafka consumer which has been running for few days perfectly. Yesterday the broker went down. Since then the consumer is showing 100% cpu usage. The usage went down considerably (under 10%) when the broker was up. I am curious why the usage is 100% (or near 100%) when broker is down? I don't see anything in the logs.
Upvotes: 5
Views: 11665
Reputation: 31
Increase in CPU utilisation for both kafka consumer and broker usually happens because of very high frequency of poll requests from consumer. This mainly happens because of inefficient configuration for consumer.
Check for two properties :
If data in topic is not that frequently produced then keep fairly high value of fetch.max.wait.ms and non-zero value of fetch.min.bytes to avoid frequent poll requests to broker
Upvotes: 3
Reputation: 9206
I've solved the problem by upgrading kafka from:
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka_2.11</artifactId>
<version>0.11.0.1</version>
</dependency>
to
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka_2.12</artifactId>
<version>2.0.1</version>
</dependency>
Upvotes: 1