# Usage, budgets and suspension

> How storage and compute accrue, what warehouse limits do at 80% and 100%, and what happens when a budget suspends your warehouses.

A warehouse is billed for what it holds and what it runs, and sanda gives you three separate ways to keep that under control. They behave differently, and it helps to know which one you are looking at.

| | Warehouse limits | Monthly budget | Trial credit |
|---|---|---|---|
| Set | Per warehouse, from **Limits** on its card, at or below your edition's | For the workspace, in **Settings · Plan & budget** | By sanda, for a trial only |
| Measured against | Storage held, compute per day, concurrent queries, statement length | The month's metered spend: storage, compute, sync runs and AI, priced as the invoice prices it | A trial's usage, against its free credit of A$10 |
| At the ceiling | Loading pauses and queries are throttled on that warehouse. Reads and reports keep working. | **Every warehouse in the workspace is suspended** | The workspace is **frozen** |
| Comes back | By itself, when usage falls under the limit or the limit is raised | When an owner or admin resumes it | When the workspace moves to an edition |

## How usage accrues

**Storage** is a level, not a flow. A reading is held until the next one, and each day's figure is the time-weighted average of what the warehouse held that day. The bill is the GB-months held across the month, at A$1.06 per GB-month.

**Compute** is a flow. Each reading records the work done since the one before it. That work is the sum of the minutes the warehouse was kept awake for you (each counts at half a vCPU), plus the larger of what your queries executed and what your recorded runs took. Compute is billed at A$0.483 per compute hour used.

Both are shown in the console on each warehouse's card:

- the **Storage** and **Compute** meters show today against the warehouse's limits;
- **Storage held** and **Compute run** show the last 30 days, with a note under them of the dates covered and how many days had no reading;
- **Compute run** reads **measuring** until a warehouse has a second reading, because compute is the difference between two readings;
- **Run rate** carries today's usage across a month. It is an estimate for planning. The invoice adds up the real readings.

A reading is taken when someone opens the **Overview** or **Warehouse** page (a warehouse read in the last 45 seconds is skipped), when an owner or admin presses **Measure now**, and about hourly in the background. See [Billing usage](https://docs.sanda-os.com.au/billing/usage) for how readings become the lines on an invoice.

## Warehouse limits

Every warehouse has four limits, shown under **Limits** on its card:

| Field | What it limits |
|---|---|
| **Storage limit (GB)** | How much the warehouse may hold. |
| **Compute limit (hours/day)** | The compute the warehouse may use in a day. At the limit, sanda throttles queries and pauses loading (see the states below). |
| **Concurrent queries** | How many queries can run at once. |
| **Statement ceiling (ms)** | How long one statement may run before it is stopped. |

A warehouse starts at your edition's limits: for storage 10 GB on Basic, 100 GB on Standard and 16 TB on Enterprise. A limit is not a price. You pay for what is held and what runs, so setting a limit lower is a way to hold a month's spend down.

:::steps
1. **Open Limits.** On **Data · Warehouse**, press **Limits** on the card. Only owners and admins can change them.
2. **Change a field.** Values above your edition's are refused with a sentence naming what your edition allows.
3. **Read the worst case.** Under the form, sanda shows the most a month could cost at those limits, split into storage and compute.
4. **Press Apply limits.** They take effect straight away. sanda does not wait for the next reading.
:::

### What the states mean

sanda compares the warehouse's storage and its daily compute pace with its limits after every reading, and shows the worst of the two as the state.

| State | Meaning | What sanda does |
|---|---|---|
| `ok` | **Inside its limits.** | Nothing. |
| `warning` | **Past 80% of a limit: worth a look before it bites.** The card shows a `capacity · warning` pill. | Nothing changes, and it emails your alert recipients if capacity alerts are on. |
| `over` | **At a limit: syncs are paused and queries are throttled until it comes back under, or the limit moves.** | Loading is paused: syncs and CSV uploads cannot write. Concurrent queries are cut to a quarter of the limit, and queries are limited to 15 seconds. Reads and reports keep working, more slowly. |
| `frozen` | **Held by sanda. Talk to us.** | sanda holds it, and a reading does not clear it. |

`warning` and `over` clear on their own at the next reading once usage is back under the limit or the limit has moved. Nothing is deleted at any state.

## Budgets and suspension

A monthly budget is a ceiling on the workspace's spend. You set it in **Settings · Plan & budget**, in the **Budget & alerts** panel, as **Monthly budget (AUD)**. Leave it empty for no budget and no ceiling.

Below 100% the thresholds you tick are reminders by email and nothing more. When the month's metered spend reaches the budget, sanda suspends every warehouse in the workspace. sanda checks budgets regularly, so a workspace can spend a little past its budget before the check catches it.

![The suspension banner shown across the console](https://docs.sanda-os.com.au/media/warehouse-suspended.png "The banner that appears on every page while a workspace is suspended")

### What stops, and what is kept

Suspension stops everything that opens a warehouse on your behalf: queries, reports, cherry chat, syncs, CSV uploads, scheduled tasks and rebuilds, sanda search indexing, the OData feed, connected assistants, the Explorer, Modelling and the SQL shell. Each shows a sentence saying the warehouse is suspended, and since when.

What is kept:

- **Your data.** Nothing is deleted.
- **Metering.** Storage keeps being measured and billed, because it is still held.
- **The console.** You can still sign in, open the **Warehouse** page and change settings.
- **The sanda learning dataset**, which is free and shared.

Scheduled tasks are not queued while the workspace is suspended, and they do not replay the ticks they missed: once resumed, a task carries on from its next scheduled time. A run that was queued before the suspension ends with the suspension message and does not count towards the task's failures.

The suspension does not lift on its own: not at midnight, not at the start of the month, not when you raise the budget. Someone has to resume it.

### Resume a suspended warehouse

:::steps
1. **Open Budget & alerts.** Go to **Settings · Plan & budget**. The panel shows **Warehouse suspended since** the date it happened.
2. **Change what caused it.** Raise or remove the **Monthly budget** and press **Save budget & alerts**, or wait for a new month to begin. sanda only lets you resume once the month's spend is under the budget, because a warehouse resumed while still over would be suspended again at the next check.
3. **Press Resume warehouse.** The button is disabled while the month is at or over the budget, and the panel says why. Only an owner or admin can press it.
:::

When it works, the panel says **Resumed. Queries, syncs and scheduled runs are back.**

## A trial's free credit

A trial has a free credit. Compute, storage, AI and sync runs draw it down at the same prices an invoice would use. When it is spent, or when the trial reaches its end date, the workspace is **frozen**: the same suspension as above, with the same list of what stops plus AI, and the data is kept. The card shows `frozen · trial`.

**Resume does not lift a freeze.** Moving the workspace to an edition does, and it then carries on where it stopped. An owner can ask for that under **Settings · Plan & budget**. See [Trial](https://docs.sanda-os.com.au/billing/trial) and [Editions](https://docs.sanda-os.com.au/billing/editions).

## Get told before it happens

In **Settings · Plan & budget**, the **Budget & alerts** panel lets you tick the thresholds you want a reminder at, add up to ten extra recipients (owners and admins always receive alerts), and switch on emails for capacity warnings and for failed scheduled runs. The budget itself is set there too. [Budgets and limits](https://docs.sanda-os.com.au/billing/budgets-and-limits) covers the panel in full.

:::links
- [Billing usage](https://docs.sanda-os.com.au/billing/usage): How readings become an invoice.
- [Budgets and limits](https://docs.sanda-os.com.au/billing/budgets-and-limits): The Budget & alerts panel.
- [Optimise](https://docs.sanda-os.com.au/warehouse/optimise): Give storage back and cut wasted compute.
:::
