Scheduled scaling

[Edit this page](https://github.com/ClickHouse/clickhouse-docs/blob/main/docs/cloud/features/04_automatic_scaling/07_scheduled_scaling.md)

Private preview

ClickHouse Cloud services automatically scale based on CPU and memory utilization, but many workloads follow predictable patterns — daily ingestion spikes, batch jobs that run overnight, or traffic that drops sharply on weekends. For these use cases, Scheduled Scaling lets you define exactly when your service should scale up or down, independent of real-time metrics.

With Scheduled Scaling, you configure a set of time-based rules directly in the ClickHouse Cloud console. Each rule specifies a time, a recurrence (daily, weekly, or custom), and the target size — either the number of replicas (horizontal) or the memory tier (vertical). At the scheduled time, ClickHouse Cloud automatically applies the change, so your service is sized appropriately before demand arrives rather than reacting after the fact.

This is distinct from metric-based autoscaling, which responds dynamically to CPU and memory pressure. Scheduled Scaling is deterministic: you know exactly when the scaling will happen and to what size. The two approaches are complementary — a service can have a baseline scaling schedule and still benefit from autoscaling within that window if workloads fluctuate unexpectedly.

Scheduled Scaling is currently available in **Private Preview**. To enable it for your organization, contact the ClickHouse support team.

## Setting up a scaling schedule[​](#setting-up-a-scaling-schedule "Direct link to Setting up a scaling schedule")

To configure a schedule, navigate to your service in the ClickHouse Cloud console and go to settings. From there, select **Schedule Override** and add a new rule.

Each rule requires:

- **Time:** When the scaling action should occur (in your local timezone)
- **Recurrence:** How often the rule repeats (e.g. every weekday, every Sunday)
- **Target size:** The number of replicas or memory allocation to scale to

Multiple rules can be combined to form a full weekly schedule. For example, you might scale out to 5 replicas every weekday at 6 AM and scale back to 2 replicas at 8 PM.

## Use cases[​](#use-cases "Direct link to Use cases")

**Batch and ETL workloads:** Scale up before a nightly ingest job runs and scale back down once it completes, avoiding over-provisioning during idle daytime hours.

**Predictable traffic patterns:** Services with consistent peak hours (e.g. business-hours query traffic) can be pre-scaled to handle load before it arrives, rather than waiting for autoscaling to react.

**Weekend scale-down:** Reduce replica count or memory tier over weekends when demand is lower, then restore capacity before the Monday morning surge.

**Cost control:** For teams managing ClickHouse Cloud spend, scheduled scale-downs during known low-utilization periods can meaningfully reduce resource consumption without any manual intervention.

Note

A scheduled scaling action and a concurrent autoscaling recommendation may interact — the schedule takes precedence at its trigger time.

## Handling spikes in workload[​](#handling-bursty-workloads "Direct link to Handling spikes in workload")

If you have an upcoming expected spike in your workload, you can use the
[ClickHouse Cloud API](/docs/cloud/manage/api/api-overview) to
preemptively scale up your service to handle the spike and scale it down once
the demand subsides.

To understand the current CPU cores and memory in use for
each of your replicas, you can run the query below:

```
SELECT *
FROM clusterAllReplicas('default', view(
    SELECT
        hostname() AS server,
        anyIf(value, metric = 'CGroupMaxCPU') AS cpu_cores,
        formatReadableSize(anyIf(value, metric = 'CGroupMemoryTotal')) AS memory
    FROM system.asynchronous_metrics
))
ORDER BY server ASC
SETTINGS skip_unavailable_shards = 1
```

- [Setting up a scaling schedule](#setting-up-a-scaling-schedule)- [Use cases](#use-cases)- [Handling spikes in workload](#handling-bursty-workloads)

Was this page helpful?