---
title: "Supabase Disk IO Budget on Nano: What Burns It, How to Measure"
description: "Supabase Disk IO Budget warnings on Nano are often swap, not queries. The exact metrics endpoint, metric names and fixes, from a project that went down for 24h."
canonical: "https://www.razi.pro/blog/supabase-disk-io-budget-nano"
date: "2026-12-03"
tags: ["Supabase", "PostgreSQL", "Performance", "Monitoring", "DevOps"]
source: "razi.pro"
---

# Supabase Disk IO Budget on Nano: What Burns It, How to Measure

Before you read on: your Supabase project is emailing you that it is "running out of Disk IO Budget", but every query in the dashboard looks cheap. What is reading the disk?

On my project, the answer was not a query. It was the operating system, swapping. Postgres itself had read about five thousand pages since the last restart. The machine underneath had read **18.9 GB**.

This post is how I found that out, the exact metric names that show it, what I changed, and when you should stop tuning and just pay for Micro.

---

## The symptom

The first warning email arrived on 8 September 2026. More followed for a month. I did what you would do: I looked at slow queries, table sizes and index usage. Nothing looked expensive.

On 4 October the project stopped answering. Every REST call came back as a **522** for more than 24 hours. A restart brought it back.

That matches Supabase's own [High Disk I/O troubleshooting page](https://supabase.com/docs/guides/troubleshooting/exhaust-disk-io), which lists what happens when the budget is gone: response times climb, CPU rises from IO wait, backups and autovacuum get interrupted, and the instance can stop responding altogether. The last one is the one that gets you.

---

## Why: the budget, and what spends it

Each compute size has a **baseline** disk performance and a higher **maximum**. From the [Compute and Disk docs](https://supabase.com/docs/guides/platform/compute-and-disk):

| Compute | Memory | Baseline IOPS | Max IOPS | Baseline throughput | Max throughput |
|---|---|---|---|---|---|
| Nano (Free Plan) | up to 0.5 GB | 250 | 11,800 | 5 MB/s | 261 MB/s |
| Micro | 1 GB | 500 | 11,800 | 11 MB/s | 261 MB/s |

The docs say compute sizes up to 2XL "can burst above their baseline for short periods of time, drawing on a disk IO budget", and that once the budget is exhausted, performance returns to baseline. They do not say how big the budget is, so I won't guess a number here. What matters is the shape: short bursts are free, sustained reading above 5 MB/s on Nano is not.

Now the part that surprised me. The troubleshooting page also says this:

> Every Supabase project has 1GB of disk allocated for swapping.

So when the machine runs out of RAM, it does not crash. It quietly starts paging memory to disk and back. Every one of those page-ins is disk IO, and it is billed against the same budget as your queries.

My Nano instance had **426 MB** of RAM visible to the OS. Postgres's `shared_buffers` was set to **224 MB**. That is more than half the machine given to one cache, before counting connections, PostgREST, the auth service, the pooler and everything else that runs on the box. There was nowhere left to put anything, so the kernel swapped all day.

> **A warning worth the detour.**
> `pg_stat_statements` and `pg_stat_io` only count IO that Postgres asked for. Swap traffic is the kernel moving process memory, and Postgres never sees it. So the database's own statistics will tell you everything is fine while the disk is saturated. I spent an afternoon dropping indexes because of this. Look at the host metrics first; it takes five minutes.

---

## How to measure it

Supabase exposes a Prometheus endpoint for every project. It is documented on the [Metrics page](https://supabase.com/docs/guides/telemetry/metrics):

```
https://<project-ref>.supabase.co/customer/v1/privileged/metrics
```

It uses HTTP Basic Auth. The username is `service_role`. The password is a secret API key from **Project Settings → API Keys** (the new ones start with `sb_secret_`). On my project the older service-role key also worked at the time. Treat either as a root password: keep it out of shell history and out of the browser.

```bash
curl -s -u "service_role:$SUPABASE_SECRET_KEY" \
  "https://<project-ref>.supabase.co/customer/v1/privileged/metrics" \
  > metrics.txt
```

The output is a few thousand lines of plain text. You only need a handful:

```bash
grep -E '^node_vmstat_pswp(in|out)|^node_memory_(MemTotal|MemAvailable|Swap[A-Za-z]+)_bytes|^node_disk_read_bytes_total' metrics.txt
```

What each one tells you:

- **`node_memory_MemTotal_bytes`**: the RAM the OS actually has. Mine said about 426 MB.
- **`node_memory_SwapTotal_bytes`** and **`node_memory_SwapFree_bytes`**: how much of the 1 GB swap is in use. If "free" is far below "total", you are living in swap.
- **`node_vmstat_pswpin`** and **`node_vmstat_pswpout`**: cumulative pages swapped in and out since boot. These are counters. Take two samples a few minutes apart and subtract. If `pswpin` keeps climbing while the app is idle, that is your budget leaking.
- **`node_disk_read_bytes_total`**: total bytes read from disk, by device, since boot. This is the number that showed 18.9 GB for me.

These are standard Linux node-exporter metrics. You don't have to trust me that Supabase exports them: the official [supabase-grafana dashboard](https://github.com/supabase/supabase-grafana) charts every one of them.

Then compare with what Postgres thinks it read. On Postgres 16 and later, `pg_stat_io` has it:

```sql
select backend_type, object, context, reads, writes
from pg_stat_io
where reads > 0 or writes > 0
order by reads desc;
```

If you have Postgres 15 or older, `pg_stat_database.blks_read` gives a coarser version of the same answer.

`reads` here are 8 KB pages, so multiply by 8192 to compare. My sum was around five thousand pages, or roughly 40 MB. Against 18.9 GB of disk reads, that is a rounding error. When the host has read hundreds of times more than Postgres, the difference is swap, and no query tuning will close it.

If you would rather look at graphs, the Metrics page offers two routes: a Grafana Cloud integration from the dashboard, or self-hosting the [supabase-grafana](https://github.com/supabase/supabase-grafana) repo. I used plain `curl` and `grep`; I have not tried either Grafana route on this project. The dashboard's own Observability section can also show **Disk IO % Consumed** as a custom report, according to the troubleshooting page.

---

## What I changed

I'll list these in the order I did them, which is not the order of how much they helped.

### 1. Dropped seven unused indexes (helped writes, wasn't the cause)

My busiest table was an API usage log, about 3,500 rows a day, carrying **13 indexes**. Every insert wrote 13 index pages. The warnings had started the day that table shipped, so it looked guilty.

`pg_stat_user_indexes` showed seven of the 13 with **zero scans**. I dropped them:

```sql
select indexrelname, idx_scan
from pg_stat_user_indexes
where relname = 'api_usage_log'
order by idx_scan;
```

That was worth doing and I'd do it again. It did not stop the emails, because the table was never the main consumer. It is the classic trap: the database statistics pointed at the database.

### 2. Stopped writing rows nobody reads

The bigger lesson was about the shape of writes, not their count. Two patterns were spending IO for nothing:

- **Per-request logging.** Bots hitting my MCP endpoint made thousands of handshake calls a day. Each one used to become a row. Now handshake chatter is not logged at all, and only meaningful events are. Counters live in memory or Redis, not in Postgres. (Redis has its own free-plan ceiling, so I don't move everything there either.)
- **Per-row updates from automation.** An [n8n workflow](https://www.razi.pro/blog/n8n-workflow-automation-examples) was updating news articles one PostgREST `PATCH` at a time. Each request is its own transaction, its own WAL write, its own index updates. I replaced that with a few Postgres functions that take an array and do one `insert ... on conflict` or one `update ... from`. If your n8n talks to Supabase, a single RPC per batch is the cheapest shape you can give it. (If you run n8n alongside a Next.js app, [this is how I embed it](https://www.razi.pro/blog/how-to-embed-n8n-in-nextjs).)

### 3. Shrinking shared_buffers (the real fix for swap; not yet applied)

The direct fix for my swap is giving the rest of the machine its RAM back. `shared_buffers` at 224 MB on a 426 MB box is the obvious lever, and 128 MB is the value I'd start with.

It can only be changed with the Supabase CLI, per the [custom Postgres config docs](https://supabase.com/docs/guides/database/custom-postgres-config):

```bash
supabase postgres-config update --config shared_buffers=128MB \
  --remote=<project-ref> --experimental
```

The docs warn that this restarts the database, so expect a short drop in connections. Run `supabase postgres-config update --help` first to confirm the flags on your CLI version.

I have **not** confirmed this one end to end. My CLI login got a **403** on the postgres-config call, because the account it used was not the project owner. So this step is "known fix, not tried by me yet". If you try it, measure `pswpin` before and after, the same way as above, and you will know within an hour whether it worked.

A smaller cache means more real reads from disk. That sounds backwards, but a cache miss costs one 8 KB read, while swap thrashing costs reads and writes for memory that every process needs all the time. On a box this small the trade is usually worth it. Watch your cache hit rate afterwards to be sure.

---

## When to just upgrade

Tuning a Nano instance is fun the first time. Here is when I'd stop:

- **Swap is still climbing after you've cut `shared_buffers`.** Then the RAM is simply too small for the services running on it. Micro doubles the memory to 1 GB and doubles the baseline to 500 IOPS and 11 MB/s.
- **Your real workload sits above baseline.** If even with no swap your steady read rate is above 5 MB/s, the budget will drain no matter what you do. That is not a bug, it is the plan.
- **The project matters to someone.** An unresponsive database for 24 hours cost me more attention than a month of Micro would have cost money.

Note that Nano only exists on the Free Plan. The compute docs say you cannot launch new Nano instances on paid plans, and a Nano carried into a paid organization is billed at the Micro price. So if you are paying anyway, you are already paying for Micro; you may as well have it.

---

## The short version

- The Disk IO budget is spent by **all** disk reads and writes on the instance, including swap.
- On Nano, RAM is tight enough that swap can dominate. Postgres's own stats will not show it.
- Measure with the privileged metrics endpoint: `node_vmstat_pswpin`, `node_memory_Swap*` and `node_disk_read_bytes_total`, against `pg_stat_io`.
- Cut what you write: no per-request rows, no unused indexes, batch your automation into RPCs.
- Give RAM back by lowering `shared_buffers`. If swap still climbs, upgrade to Micro.

The emails were right that I was running out of something. They just never said what.
