# Snowflake Warehouse Auto-Suspend Not Tuned

> Flags Snowflake warehouses with AUTO_SUSPEND unset, disabled, or above 120 seconds, which keeps idle compute billing.

Source: https://zop.dev/integrations/snowflake/recommendations/snowflake-warehouse-auto-suspend-not-tuned

---

## Idle seconds bill at the full warehouse rate

A Snowflake warehouse consumes credits for every second it runs, with a
[60-second minimum each time it starts](https://docs.snowflake.com/en/user-guide/warehouses-overview). Auto-suspend is what
stops it after the last query. [CREATE WAREHOUSE](https://docs.snowflake.com/en/sql-reference/sql/create-warehouse) sets
`AUTO_SUSPEND` to 600 seconds by default, and a value of 0 or NULL means the warehouse never
suspends, which Snowflake warns can consume significant credits, especially on larger sizes.

Snowflake's own [warehouse guidance](https://docs.snowflake.com/en/user-guide/warehouses-considerations) recommends a low value
such as 5 or 10 minutes or less because billing is per second. On a Medium warehouse, at 4 credits an
hour on Gen1, every ten-minute tail after a burst of queries is two-thirds of a credit spent on
nothing.

## Reading the setting from SHOW WAREHOUSES

```sql
SHOW WAREHOUSES
  ->> SELECT "name", "size", "auto_suspend", "auto_resume"
      FROM $1
      WHERE "auto_suspend" IS NULL
         OR "auto_suspend" = 0
         OR "auto_suspend" > 120
      ORDER BY "size";
```

The `->>` pipe operator lets you filter [SHOW WAREHOUSES](https://docs.snowflake.com/en/sql-reference/sql/show-warehouses)
output; column names are lowercase and must be double-quoted. A null `auto_suspend` means the
warehouse will not suspend on its own. SHOW WAREHOUSES lists only warehouses your role has some
privilege on, so run it with a role that can see all of them.

## Three settings that trigger the finding

ZopNight reads the warehouse's auto-suspend value and fires when it is missing, empty, zero, or a
number above 120 seconds. Because the Snowflake default is 600 seconds, any warehouse created without
an explicit value qualifies. No usage metric is involved: a warehouse is flagged for its
configuration even if it has not run recently.

## Values the check accepts

Any auto-suspend of 120 seconds or less passes. The rule does not look at how often queries arrive,
so it will not tell you that 60 seconds is too short for a workload with regular two-minute gaps.
Warehouses that burn credits with no queries at all are covered separately by
[Snowflake Warehouse Idle](https://zop.dev/integrations/snowflake/recommendations/snowflake-warehouse-idle).

## No dollar figure, and what the idle tail costs

This is a governance finding with no saving attached, since the idle time between queries depends on
traffic patterns ZopNight does not model here. The waste per suspend cycle is the gap between the
last query and the suspend timer, at the warehouse's hourly credit rate.

## Tightening auto-suspend

1. Look at the warehouse's typical gap between queries. If gaps are shorter than the new timer,
   the warehouse will keep running anyway; if they are just longer, each resume costs the 60-second
   minimum.
2. Set a short timer: `ALTER WAREHOUSE <name> SET AUTO_SUSPEND = 60;` Snowflake checks for
   suspension about every 30 seconds, so values below 30 or not a multiple of 30 may not behave as
   expected.
3. Keep `AUTO_RESUME = TRUE` so the next query wakes it.

**Note**
Suspending drops the warehouse's local data cache, so the first queries after a resume can be
slower. For latency-critical dashboards, weigh that against the credits saved.
