Auto-Scaling for Spiky Workloads: Designing Snowflake for Interactive Analytics
William McKnight and Jake Dolezal
TL;DR:
- Snowflake Interactive Analytics scaled automatically through a 5x traffic spike. 99.997% of queries met the SLA, and p99 latency stayed at 255 ms, 40% lower than peak-sized ClickHouse Cloud.
- ClickHouse Cloud can’t add replicas automatically today. Sized for normal traffic, it served 0% of spike queries within SLA and was still behind an hour later.
- To match Snowflake’s results, ClickHouse has to run peak-sized capacity 24/7. Over a year of weekly spikes, that costs nearly 2x as much: $31,273 vs. $15,959.
- Snowflake added capacity on its own within 2–3 minutes, with no operator, script, or capacity guess.
It is a Friday evening and a flash sale goes viral, and the dashboard behind real-time inventory, fraud monitoring, and marketing attribution suddenly takes five times its normal query traffic. Twenty minutes later the sale cools off and traffic drifts back to normal.
The questions that matter are as follows:
- How quickly does usable capacity arrive once the spike starts?
- What happens to p95 and p99 latency in the first minutes of the spike?
- What are you still paying for during the other 23 hours of the day, and what if this happens week after week, all year long?
On Snowflake, an Interactive warehouse with multiple clusters adds clusters on its own when it sees queuing coming and retires them once their billed hour is up. On ClickHouse Cloud, without horizontal autoscaling, you choose a size ahead of time: provision for the peak and pay for it all year, provision for the baseline and hope the spike never comes, or resize the service by hand whenever spikes occur.
Why this scenario
Spiky demand is the normal shape of customer-facing analytics, not the exception. Retail has flash sales and holiday peaks, media has breaking news, finance has market opens and IPOs, and SaaS products have the Monday-morning login wave. What makes it hard is not the size of the peak but its timing:
- The peak is unpredictable. If you knew when it was coming you would schedule capacity for it. Most spikes come from outside the business: a post that goes viral, a competitor’s outage, a news report
- The peak is short. Twenty minutes of heavy traffic a week is a few percent of the hours you pay for
- The cost of being wrong is visible. A dashboard that times out during the sale is the one moment everyone is watching
Three ways to pay for a spike
- Provision for the peak. The dashboard never misses, but peak-sized capacity runs around the clock, including every quiet night and weekend.
- Provision for the baseline. The bill is small, until the spike arrives and queries back up faster than the service can clear them.
- Let the platform scale. Capacity follows demand, and you pay for what was actually running. The questions are how fast it reacts, what it costs while it reacts, and how much headroom it keeps.
Snowflake Interactive warehouses take the third path by default. ClickHouse Cloud offers vertical autoscaling, which changes the size of each replica rather than the number of replicas, and horizontal autoscaling, which changes the replica count (but is in Private Preview and was not available to us). ClickHouse documents its horizontal recommender as running on a ten-minute cycle that is not designed for sub-minute spikes. For an unpredictable spike, that leaves the first two paths, or calling the database administrator in afterhours.
Our Central Focus
We framed the following questions to test the two platforms:
- How fast does capacity arrive? Measured from the moment traffic starts to rise, not from when someone notices
- What happens to latency during the spike? p95 and p99, measured from when each query was scheduled to run, so a growing backlog counts against the platform rather than hiding inside the load generator
- What does a wrong sizing guess cost? The same ClickHouse product configured for the peak and for the baseline
- What does a year of spikes cost? Total compute over a year with one unpredictable spike a week, with every configuration held to the same latency objective
The Test
We built the test around retail order data: one row per order line item, with the customer, product, category, channel, destination country, quantity, revenue, and a return flag.
- 500 million order lines. Three years of history, 15.8 million customers and 500,000 products. Category popularity is heavily skewed: the top category carries about a fifth of the orders on a typical day.
- One snapshot, two engines. Both engines were loaded from the same Parquet export of the same Snowflake table, and we checked 18 aggregates (row counts, distinct counts, sums, NULL counts, date range) to confirm they hold identical data.
- Matched physical layout. For Snowflake, an interactive table with CLUSTER BY (ORDER_DATE, CUSTOMER_ID). For ClickHouse, a MergeTree with ORDER BY (order_date, customer_id).
- Result caching off on both. USE_CACHED_RESULT = FALSE on Snowflake and use_query_cache = 0 on ClickHouse, so every query does real work.
The query mix is eight dashboard queries in two tiers. Every query returns identical results on both engines, with platform syntax differences only where the dialects differ. Time windows are anchored to the last day of the data rather than to the current date.
Light tier (60% of traffic)
- B4-L1: Order-detail drill-down. A primary-key lookup on order_line_id, drawn from a pre-sampled list so no key repeats.
- B4-L2: Returns widget. Count, revenue, and units of returned lines over the trailing seven days.
- B4-L3: Category revenue widget. Revenue, units, and lines for one category over one day, rotated across the 50 busiest categories.
Medium tier (40% of traffic)
- B4-M1: Hourly revenue and order lines by channel, trailing 24 hours.
- B4-M2: Top-10 products by revenue over the trailing seven days.
- B4-M3: Revenue and exact distinct customers by country over the trailing 30 days.
- B4-M4: Last-hour totals: order lines, revenue, units, and exact distinct customers.
- B4-M5: Per-channel summary with return rate, trailing 24 hours.
Every query in the mix runs in roughly 0.1 to 1 second on its own on both engines, well inside the five-second ceiling of a Snowflake Interactive warehouse.
Compute Cost
We priced both platforms with the same list rates used throughout this series.
| ClickHouse | Snowflake | |
| Account tier | Scale ($0.2985/8 GiB/hour) | Enterprise ($3.00/credit) |
| Unit of compute | 1 replica: 8 vCPU / 32 GiB | 1 X-Small Interactive cluster |
| Cost per unit | $1.19/hour | 0.6 credits = $1.80/hour |
| Configurations tested | Peak-sized: 3 replicas, fixed Baseline-sized: 1 replica, fixed | Interactive X-Small, 1 to 4 clusters, scaling automatically |
| Fallback warehouse | N/A | Not needed |
The replica counts were not guessed. Before the timed runs we stepped up the load against a single unit of each platform. One X-Small Interactive cluster served about 60 queries per second before queries began to queue. One 8 vCPU ClickHouse replica served about 35. Three replicas was the smallest ClickHouse configuration that kept p95 under 500 ms at the spike rate of 100 queries per second (p95 216 ms), so three replicas is the peak-sized configuration and one replica, which comfortably serves the baseline, is the baseline-sized configuration.
The Harness
Earlier blogs in this series used a closed loop, where a fixed number of workers each wait for one query to finish before sending the next. A closed loop cannot model a spike: when the engine slows down, the load generator slows down with it. For this test we built an open-loop generator.
- Scheduled arrivals. Queries arrive on a fixed-seed Poisson schedule at a target rate, whether or not earlier queries have finished. Every configuration replays the identical schedule of 223,736 queries.
- Spike. Five minutes of unscored warm-up, then 10 minutes of baseline at 20 queries per second, a 2-minute ramp to 100 queries per second, a 20-minute plateau, a 2-minute ramp back down, and a 60-minute trough at the baseline rate. The trough is long enough to see Snowflake’s added clusters retire.
- Latency from the schedule. Each query’s latency is measured from the moment it was scheduled to run. If the platform falls behind, the backlog shows up as latency.
- Three repetitions. Each configuration ran the full cycle three times, after a smoke run to validate the harness. The load generator ran on an EC2 instance in the same AWS region (us-west-2) as both services.
How to Read the Results
We defined one service-level objective before running anything, and every configuration is held to it:
- A query meets the SLA if it succeeds within one second of its scheduled time.
- A minute meets the objective if its p95 latency is 500 ms or less and no more than 0.1% of its queries fail.
- Cost is counted per query that met the SLA. A cheap configuration that misses the SLA is not a bargain; it is a broken dashboard.
Results
Both properly provisioned configurations held the objective through the spike. The baseline-sized ClickHouse service did not, and it had not recovered an hour later.
Table 1. Results over the 94-minute scored window, mean of three repetitions with 217,641 scored queries per run.
| Snowflake (auto-scaling) | ClickHouse 3 replicas | ClickHouse 1 replica | |
| Queries within SLA, whole run | 99.995% | 99.961% | 15.3% |
| Queries within SLA, during spike | 99.997% | 99.93% | 0% |
| p95 latency during spike | 188 ms | 223 ms | 22.5 minutes |
| p99 latency during spike | 255 ms | 428 ms | 23.6 minutes |
| Failed queries | 0 | 0 | 0 |
| Minutes meeting the objective (of 94) | 94 | 94 | 23 |
Snowflake Interactive Analytics had the lowest spike latency of the three, and its p99 was 40% lower than the peak-sized ClickHouse service. More important is what the chart below shows: Snowflake scaled automatically, ClickHouse did not.


Figure 1. Latency and running capacity through one spike (repetition 1). Top: p95 latency per minute on a log scale. Bottom: Snowflake clusters running against the fixed ClickHouse replica counts.
The baseline-sized ClickHouse service fell behind within the first minute of the ramp. At 100 queries per second it could serve only about a third of the arriving traffic, so a queue built for the full 20 minutes of the spike. Once the spike ended, the backlog took most of the 60-minute trough to clear: queries scheduled during a quiet period were still waiting behind queries from the spike. No query failed outright; they were simply far too late to be useful.
When we manually scaled ClickHouse, we changed the service from one replica to four through the ClickHouse Cloud API. The new replicas were reachable in 32 seconds. That’s not bad, but a resize still needs an operator, or a script, to notice the spike and act on it at the right moment.
Snowflake added capacity on its own:
Table 2. Snowflake scale-out, minutes measured from the start of the ramp.
| Clusters when spike began | Minutes to 2nd cluster | Minutes to 3rd cluster | Latency impact | |
| Repetition 1 | 1 | 3.1 | 15.6 | none |
| Repetition 2 | 1 | 1.8 | 10.5 | none |
| Repetition 3 | 1 | 2.3 | 4.5 | none |
What It Costs
A single spike understates the difference. The question a buyer actually faces is the year. We modelled a year with one spike a week on average, 52 in all, each shaped like the one we measured. Without horizontal autoscaling, the only ClickHouse configuration that meets the objective through an unpredictable spike is the peak-sized one, running all 8,760 hours of the year. Snowflake’s cost comes from what we measured: 1.00 cluster at the baseline rate, plus 2.04 billed cluster-hours added by each spike (two clusters, each billed its one-hour minimum).

Figure 2. Modelled one-year compute cost with weekly (52) spikes, $3.00 per Snowflake credit, $1.19 per ClickHouse replica-hour. Compute only; storage is excluded on both sides.
Snowflake meets the same objective as the peak-sized ClickHouse service for about two times less: $15,959 against $31,273. The peak-sized service costs 1.5 times as much. The 52 spikes account for less than 1% of Snowflake’s annual bill; almost all of it is the steady baseline. The baseline-sized ClickHouse service is cheaper still, but it misses the objective every time a spike arrives, which is the one time the dashboard matters most.
Table 3. Modelled one-year compute cost. Over roughly 636 million queries a year.
| Snowflake (auto-scaling) | ClickHouse 3 replicas | |
|---|---|---|
| Annual capacity billed | 5,320 credits | 26,280 replica-hours |
| Annual compute cost | $15,959 | $31,273 |
| Meets the objective in every spike | Yes | Yes |
| Cost per 1,000 queries | $0.032 | $0.049 |
What Each Platform Charges You For
Snowflake Interactive Analytics
- Each added cluster is billed for at least one hour, and stays up for that hour. Every spike in our test added about two cluster-hours.
- Auto-suspend has a 24-hour floor, so an Interactive warehouse is an always-on serving tier.
- Queries are capped at five seconds and retried on a Standard fallback warehouse beyond that. None of the queries in this mix needed it.
ClickHouse Cloud
- Horizontal autoscaling, which changes the replica count, is in Private Preview, is enabled by support, and is documented as running on a ten-minute recommendation cycle that is not intended for sub-minute spikes.
- Vertical autoscaling changes the size of each replica, tracks peak usage over hours-long windows, and cannot add replicas.
- Manual resizing is fast, but someone has to know when to do it.
- Automatic idling does not help a dashboard that is queried around the clock.
Lessons Learned
- The sizing guess is a real cost. ClickHouse, configured for the base workload, missed its SLA for over an hour. Configured for the peak, it would feed a dashboard that performs acceptably well but cost 2x more. Choosing between them requires knowing the peak in advance.
- Reaction time is only half of elasticity. Snowflake’s latency never moved during the spike because a new cluster arrived quickly.
- Model the year, not the event. Over a single spike the difference is modest. Over a year of unpredictable spikes, the peak-sized service pays for the peak 8,760 hours a year.
Conclusion
With ClickHouse Cloud today, an unpredictable spike leaves two choices: pay for peak capacity all year, or accept that the dashboard falls over when it matters most. In our test the baseline-sized service continued to miss its target SLA for more than an hour after a 20-minute spike, but the peak-sized service met it at a fixed cost of 2x a year.
Snowflake’s Interactive warehouse met the same objective with the lowest latency of any configuration we tested, added capacity on its own within two to three minutes of the spike, and did it for an estimated $15,959 a year at $3.00 per credit, about a third less than provisioning for the peak.
If your analytics traffic has peaks you cannot schedule, Snowflake is already architected to meet those needs today.
FAQ
- Which handles unpredictable traffic spikes better, Snowflake or ClickHouse Cloud?
Snowflake handles unpredictable traffic spikes better than ClickHouse Cloud. Interactive warehouses add clusters automatically when queuing builds and retire them when demand drops. In our 5x spike test, Snowflake kept 99.997% of queries within SLA with no intervention. A baseline-sized ClickHouse Cloud service missed its SLA for every spike query.
- Does ClickHouse Cloud support horizontal autoscaling?
ClickHouse Cloud does not generally support horizontal autoscaling; it’s in Private Preview, it must be enabled by support, and is documented as running on a 10-minute cycle that isn’t designed for short spikes. Without it, ClickHouse users have to provision for peak, accept failures, or resize manually.
- How much does ClickHouse cost for spiky workloads?
ClickHouse costs nearly 2x as much as Snowflake Interactive Analytics for spiky workloads. To meet the same latency objective through unpredictable spikes, ClickHouse must run peak-sized capacity all 8,760 hours of the year, which works out to $31,273. Snowflake meets the same objective for $15,959 by paying for extra capacity only while spikes happen.
- How fast does Snowflake Interactive Analytics scale out?
Snowflake Interactive Analytics scales out within 2–3 minutes of a spike starting. Across three test runs, with no measurable latency impact. Snowflake’s p95 latency during the spike was 188 ms.
- What does a traffic spike add to a Snowflake bill?
A traffic spike adds very little to a Snowflake bill. Each spike in our test added about two cluster-hours. Across 52 spikes a year, spikes made up less than 1% of Snowflake’s annual compute cost.
Methodology notes
- Snowflake Interactive warehouse on AWS us-west-2 at Enterprise edition pricing
- ClickHouse Cloud Scale tier, AWS us-west-2, ClickHouse 26.4, memory at 32 GiB per replica with automatic idling disabled during runs
- Two query adjustments were made for parity:
- ClickHouse has a minmax skip index on order_line_id, the equivalent of the min/max metadata Snowflake keeps automatically for every column (without it, a point lookup scanned all 500 million rows on ClickHouse against one or two of 740 micro-partitions on Snowflake)
- B4-M2 sorts NULL revenue last on both engines with product_id as a tie-breaker
- The baseline-sized ClickHouse service kept the load generator’s full pool of 512 connections busy for most of each run, so its recovery time depends on the generator’s concurrency and is shown for illustration only.
- The one-year figures are a model built from the measured runs, not a year of measurement.