Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kafka consumers wont ever exceed 16 #1122

Open
kair1337 opened this issue Mar 18, 2024 · 2 comments
Open

Kafka consumers wont ever exceed 16 #1122

kair1337 opened this issue Mar 18, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@kair1337
Copy link

kair1337 commented Mar 18, 2024

This can be due to the fact clickhouse wont spawn more threads than there is logical cores, but there's also a thread limit on clickhouse that's enforced with other various settings which are defaulted to 16 everywhere in clickhouse.

It seems the most common way to bypass the limitation is to set kafka_disable_num_consumers_limit to 1.

Would worth documenting this and providing a way to turn this on, as it can be quite limiting.

@kair1337 kair1337 added the enhancement New feature or request label Mar 18, 2024
@vincentbernat
Copy link
Member

Is it a settings to set in engine or in ClickHouse configuration? In both case, we can put it in the documentation.

@kair1337
Copy link
Author

kair1337 commented Mar 19, 2024

Hi @vincentbernat

I think the way to do this properly is like so, in the docker compose
- ../config/clickhouse/kafka_tweaks.xml:/etc/clickhouse-server/config.d/kafka_tweaks.xml:ro

kafka_tweaks.xml:

<clickhouse>
    <profiles>
        <default>
            <kafka_disable_num_consumers_limit>1</kafka_disable_num_consumers_limit>
        </default>
    </profiles>

    <background_message_broker_schedule_pool_size>32</background_message_broker_schedule_pool_size>
    <background_distributed_schedule_pool_size>32</background_distributed_schedule_pool_size>
</clickhouse>

As per the title of the issue, by default clickhouse will limit you to 16 consumers for Kafka which isn't enough in heavy deployments. Also if using a VM it will /2 the vCPUs as your limit, kafka_disable_num_consumers_limit turns that off and allows it to go past 16 in general so long as the other two settings which are defaulted to 16 are set higher than 16.

I haven't had the chance to fully test this myself on a heavy running Akvorado instance, but I've noticed the main bottleneck has been not being able to scale out the consumers, which this should resolve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants