Skip to content

Clickhouse doesn't respect cgroup limits #2261

@tobad357

Description

@tobad357

Currently getNumberOfPhysicalCPUCores doesn't respect if CK is run inside of a docker container / cgroup. It will return the actual amount of cores on the host instead of the limited amount
Which I'm guessing means CK sizes thread pools etc to use all CPUs instead of the allocated amount

Suggested would be to read /sys/fs/cgroup/cpu/cpu.cfs_quota_us if > -1 and divide by 1000 and round up to closest integer

For memory CK could read /sys/fs/cgroup/memory/memory.limit_in_bytes if available

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions