ClickHouse system logs silently consumed 12 GB and triggered millions of needless merges
A developer running a self-hosted observability stack on a budget 2-core VPS noticed ClickHouse consuming 880 MB of RAM and heavy disk activity despite near-zero application traffic. Investigation revealed ClickHouse's own internal system logs — including trace_log, asynchronous_metric_log, and text_log — had grown to 579 MB and 46 million rows, dwarfing the 543 KB of actual application data. These logs, which carry no TTL by default, were responsible for 98.8% of all database inserts and triggered a 1:678 merge amplification ratio, meaning 678 existing rows were rewritten for every new row added. Disabling the heavy system logs reduced merged rows from 11 million to just 5,727 per 30-second window and freed 2.7 GB of disk space. The developer also flagged a common debugging pitfall: Docker stats reports CPU as a percentage of one core, causing apparent resource usage to appear twice as high as actual host-level consumption.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in