Fixed cadence to seconds: making ClickHouse Cloud autoscaling more reactive
ClickHouse Cloud's vertical autoscaling recommender moved from a fixed timer loop to a controller-runtime based design, so services that hit memory pressure get a recommendation in seconds instead of waiting for the next scheduled pass. Two sources, a slotted periodic sweep and a reactive poller, feed one rate-limited work queue. The queue provides deduplication, exponential backoff, bounded concurrency and leader election without custom code. The reactive signals live in ClickHouse: a materialized view filters breach rows such as soft memory rejections out of the Prometheus metrics firehose into a small TTL'd table ordered by timestamp, which is polled every few seconds with a cheap five-minute window query.
Related posts
- Smarter Auto-Scaling for ClickHouse: The Two-Window Approach
ClickHouse mediumAdept
ClickHouse Cloud replaced its single 30-hour lookback window for vertical auto-scaling with a two-window recommender. A 3-hour window drives fast scale-downs, and a 30-hour window drives single-step scale-ups to the longer-term peak. A merge table chooses between the windows, and a hunting check compares the current and previous small-window recommendations so allocation doesn't flip-flop when usage is rising. The old fixed 2x/0.5x CPU thresholds caused cascading scale-ups and oscillations, so they were replaced with target-tracking. Target-tracking scales to peak usage divided by a target utilization set at the geometric mean of the watermarks, which makes scaling reversible and prevents allocation drift. Scale-down latency fell from 30 hours to 3 hours, with fewer oscillations and lower infrastructure cost.
- Enhanced ClickHouse Cloud Monitoring with Prometheus
ClickHouse mediumAdept
ClickHouse Cloud now exposes a Prometheus metrics endpoint through its Cloud API, authenticated with organization-level Developer API keys. Routing scrapes through the control plane means agents never wake idle instances. Scrape queries come from a limited-permission user that the data plane ignores when deciding whether to idle. Rather than querying system tables on every scrape, a Refreshable Materialized View runs the expensive multi-table query once a minute into a Memory-engine table (system.custom_metrics), which caps query load from misconfigured agents. Example configs show Prometheus (with honor_labels: true) and Datadog OpenMetrics scraping over 1000 metrics.
- What's new in clickhousectl v0.4.0
ClickHouse mediumAdept
clickhousectl v0.4.0 adds horizontal autoscaling flags for ClickHouse Cloud services (min/max replicas, mutually exclusive with vertical memory-range flags), beta ClickPipe schema discovery for Kafka and Kinesis sources, and new ingestion controls such as --skip-initial-load, --start-after for continuous object-storage pipes and --server-id for MySQL CDC pipes. Postgres config patch now does true partial updates, OAuth tokens move to a global ~/.clickhouse/tokens.json, and local server stop becomes idempotent while local remove refuses to delete a version in use unless --force is passed. The release also introduces anonymous opt-out telemetry that records flag names but never values, and can be disabled via a command, DO_NOT_TRACK=1, or compiled out with cargo build --no-default-features.
- How Modal uses ClickHouse to power real-time observability for AI workloads
ClickHouse mediumAdept
Modal powers three customer-facing observability dashboards (function scaling, per-call timeline, latency percentiles) from a single ClickHouse Cloud table ingesting 1–2 million events per minute and holding ~500 billion logs. Function-call lifecycle events (queued, executing, finished) stream through Kafka and ClickPipes into a ReplacingMergeTree table keyed on function_id, function_call_id and event_at, with ULIDs enabling primary-key range queries. Queries reconstruct call state with GROUP BY function_call_id and argMaxIf for the latest status, and compute P50/P90/P99 queue and execution latency directly with quantile functions. The team reached this scale without indexes, projections or materialized views, and is only now starting latency optimizations.
- Building ClickCannon - a tool for benchmarking ClickHouse
ClickHouse mediumAdept
ClickCannon is an open-source Go tool for benchmarking ClickHouse insert and query workloads, built to produce hardware sizing recommendations for ClickStack observability deployments. It replays real OpenTelemetry data stored as ZSTD-compressed Native format at a precisely controlled uncompressed throughput. A feedback-loop rate limiter combines a sliding window with a token-bucket gate. Independently scaled disk and insert worker pools exchange reusable ch-go blocks through Go channels, which avoids allocations. Block and connection retirement kept memory flat across 30-day runs, and configurable workflows with think times, time ranges and latency percentile targets simulate concurrent users querying while data arrives.