confluentinc / confluent-kafka-dotnet

Confluent's Apache Kafka .NET client
https://github.com/confluentinc/confluent-kafka-dotnet/wiki
Apache License 2.0
2.78k stars 847 forks source link

Too many threads in the process for a single consumer #2232

Open mruslan97 opened 2 weeks ago

mruslan97 commented 2 weeks ago

Description

Hello everyone! I have a question regarding the number of threads being created. As far as I know, librdkafka creates the following number of threads: Total number of threads = 2 + Number of brokers. However, when using the library in .NET, approximately 10-15 threads are consumed when creating and connecting a consumer, with the number of brokers being 3. What could be the reason for this? Are these some overheads of the .NET library? Is it possible to reduce their number in any way?

How to reproduce

Сreating a single consumer

image

Checklist

Please provide the following information: