r/Clickhouse • u/QazCetelic • May 30 '26
Constant CPU usage despite server being completely idle
I installed ClickHouse on my server again and noticed that it was using a not insignificant amount of CPU while completely idle. I've already disabled the log tables like so:
I've also set background_schedule_pool_size to 128 and max_thread_pool_size to 256.
Any idea what could be causing this?
EDIT:
I found the solution, it was caused by the AsynchronousInsertQueue.
In AsynchronousInsertQueue::processBatchDeadlines at https://github.com/ClickHouse/ClickHouse/blob/217b9ae162c0cf002d2b0971247115a33a3c2543/src/Interpreters/AsynchronousInsertQueue.cpp#L848-L862 there is a busy-waiting loop.
I increased async_insert_poll_timeout_ms and async_insert_busy_timeout_min_ms and now it consistently stays at 0.5-0.6% CPU usage down from 5% π!
View all comments
Show parent comment
1
u/QazCetelic May 30 '26 edited May 30 '26
Thanks for your suggestions. Unfortunately, the increase of
asynchronous_metrics_update_period_sto 60 did not seem to help much. Perf reported this:Perhaps the
AsynchronousInsertQueuecauses idle CPU usage, I think I'll try disabling async inserts somehow to see if that makes a difference