Automatic idling
Automatic idling pauses a ClickHouse Cloud service after a period without user-submitted queries, subject to the adaptive idling conditions. You can enable automatic idling and configure the inactivity duration on the service’s Settings page.What is billed while the service is paused?
You aren’t billed for compute resources while the service is paused. Storage and backups continue to be billed; idling does not remove your stored data. See pricing for billing details.What happens when a client connects to a paused service?
A paused service must become active before it can respond to queries. Connections to the service can time out while it is paused. Applications using automatic idling need to tolerate this delay and handle connection timeouts. Test your client’s timeout and retry behavior with an idle service before relying on automatic idling in production.When not to use automatic idlingAutomatic idling is suitable for services that are used infrequently and can tolerate a delay before responding to queries. It isn’t recommended for services that power customer-facing features that are used frequently. Disable automatic idling if your application cannot tolerate this delay.
When can a service enter idle?
ClickHouse Cloud implements adaptive idling to allow background maintenance to complete and to adjust the inactivity duration based on server initialization time. These conditions control when an active service can pause; the durations below aren’t a prediction or guarantee of how long a client will wait when connecting to a paused service. Adaptive idling overrides the configured inactivity duration in the following cases:- When the number of parts exceeds the maximum active parts threshold (default: 10,000), the service isn’t idled so that background maintenance can continue
- When there are ongoing merge operations, the service isn’t idled until those merges complete to avoid interrupting critical data consolidation
- Additionally, the service also adapts idle timeouts based on server initialization time:
- If server initialization time is less than 15 minutes, no adaptive timeout is applied and the customer-configured default idle timeout is used
- If server initialization time is between 15 and 30 minutes, the idle timeout is set to 15 minutes
- If server initialization time is between 30 and 60 minutes, the idle timeout is set to 30 minutes.
- If server initialization time is more than 60 minutes, the idle timeout is set to 1 hour
What background work stops while the service is paused?
The service may enter an idle state where it suspends refreshes of refreshable materialized views, consumption from S3Queue, and scheduling of new merges. Existing merge operations will complete before the service transitions to the idle state. To ensure continuous operation of refreshable materialized views and S3Queue consumption, disable the idle state functionality.