Production Hardening • PostgreSQL & BaaS Telemetry
How to Avoid Supabase Overage Bills: 7 Production Defense Tactics
Real-world tactics to prevent surprise $500+ invoices on Supabase. Fix the irreversible disk auto-expansion ratchet, proxy storage egress through Cloudflare, prevent connection leaks with Supavisor, and safely enforce Spend Caps.
⚡ 60-Second Supabase Defense Verdict✓ Verified October 2026
Disk Ratchets • Egress Proxying • MAU Thresholds
Supabase Cost Hardening Verdict: While Supabase Pro starts at $25/month, developer teams face surprise $400+ invoices due to two major drivers: Disk Auto-Expansion Ratchets (which permanently increase disk fees at $0.125/GB and cannot be downscaled without pg_dump rebuilds) and unmetered storage egress ($0.09/GB). Putting Cloudflare CDN in front of public storage buckets cuts egress bills by 95%, while setting up Supavisor connection pooling prevents compute upgrade penalties. Simulate user auth fees in our Clerk vs Supabase Auth Calculator and explore alternatives in MongoDB vs Supabase.
Disk Ratchet TrapIrreversible Scaling
Raw Egress Bandwidth$0.09 / GB (Direct)
Cloudflare CDN Fix95% Egress Eliminated
Connection LimitsUse Supavisor Port 6543
Direct Summary: Top 3 Supabase Bill Traps
The three biggest causes of unexpected Supabase overage bills are: 1) Disk Size Ratcheting: AWS EBS disk expansions cannot be shrunk, locking you into permanent $0.125/GB monthly fees; 2) Uncached Storage Egress: Public image/file downloads incur $0.09/GB overages after 250 GB; and 3) Connection Exhaustion: Stateless serverless functions opening direct port 5432 connections that exhaust RAM and force expensive compute upgrades.
Supabase Overage Leak & Savings Simulator
Calculate your exposure to disk ratcheting and egress bandwidth fees, and see how much you save with Cloudflare CDN & Spend Caps.
Supabase provisions Postgres on top of AWS EBS gp3 volumes. When your database reaches 90% disk capacity, Supabase automatically increases disk size by 50% to prevent database crashes. However, AWS does not support shrinking EBS volumes.
If a developer accidentally creates a 50 GB temporary table or bulk imports log files, the disk ratchets from 8 GB to 60 GB, then 100 GB. Even if you run DROP TABLE and VACUUM FULL, the block storage volume remains at 100 GB, costing you $11.50 every single month forever.
Fix: Before performing large data imports or migrations, check remaining disk space via the Supabase dashboard. If your disk was ratcheted accidentally, the only way to reduce costs is to run supabase db dump and restore into a fresh project.
2. Proxy Supabase Storage Through Cloudflare CDN
Supabase charges $0.09 per GB for egress once you exceed the 250 GB monthly allowance on Pro. For media-heavy web apps (user avatars, product photos, PDF receipts), bandwidth bills frequently exceed $300/month.
Fix: Route asset requests through a Cloudflare custom domain (e.g. cdn.yourdomain.com) pointing to your Supabase storage endpoint. Configure a Cache Rule in Cloudflare:
Cloudflare's global edge network will serve 95% to 99% of requests without touching Supabase, keeping egress near zero.
3. Always Connect Serverless Functions via Port 6543 (Supavisor)
Each direct PostgreSQL connection on port 5432 allocates roughly 10 MB of RAM on the database host. When serverless platforms like Vercel or AWS Lambda scale to 200 concurrent functions, Postgres runs out of RAM, throwing remaining connection slots are reserved for non-replication superuser connections.
Fix: Never use port 5432 in serverless environments. Switch your DATABASE_URL to port 6543 to utilize Supavisor's transaction pooler. With transaction pooling, 200 serverless functions can share 15 backend connections efficiently.
4. Turn ON the Spend Cap Before Launching
In the Supabase billing settings, you can toggle between Spend Cap ON and Spend Cap OFF. When Spend Cap is ON, your monthly bill is capped at $25. If you exceed 8 GB disk or 250 GB egress, services are restricted rather than incurring uncapped overage charges.
5. Filter Realtime Replication at the Publication Level
By default, adding a table to the supabase_realtime publication broadcasts every single INSERT, UPDATE, and DELETE to all connected websocket clients.
Fix: Use row-level security or custom realtime publication filters so that clients only listen to specific tenant or user IDs. This prevents hundreds of megabytes of unnecessary WAL JSON messages and saves Realtime quota.
6. Schedule Autovacuum Tuning to Avoid Table Bloat
Frequent row updates in PostgreSQL leave dead tuples. If autovacuum cannot keep up, table size swells, triggering the disk auto-expander unnecessarily. Ensure autovacuum_vacuum_scale_factor is set to 0.05 on high-write tables.
Supabase PITR allows restoring your database to any second within a 7-day or 28-day window. 7-day PITR costs $100/mo and 28-day PITR costs $280/mo per project. If you only need nightly disaster recovery, standard daily backups are included free on the Pro plan.
Supabase Pro ($25/month) includes generous baseline allowances: 8GB of database disk size, 250GB of egress bandwidth, 100GB of storage, and 100,000 Monthly Active Users (MAU). However, growing applications frequently face surprise invoices due to unconstrained bandwidth egress ($0.09 per GB) and disk auto-expansion ($0.125 per GB-month). When a web application serves high-resolution user avatars directly from Supabase Storage or triggers heavy database replication dumps, bandwidth costs quickly dwarf the base subscription fee.
// Cache Supabase storage assets at Cloudflare edge to eliminate $0.09/GB egress billing
export default {
async fetch(request: Request, env: Env): Promise {
const url = new URL(request.url);
const cacheKey = new Request(url.toString(), request);
const cache = caches.default;
let response = await cache.match(cacheKey);
if (!response) {
// Fetch from origin Supabase Storage bucket once
const supabaseUrl = `https://your-project.supabase.co/storage/v1/object/public${url.pathname}`;
response = await fetch(supabaseUrl);
const headers = new Headers(response.headers);
headers.set('Cache-Control', 'public, max-age=31536000, immutable');
response = new Response(response.body, { ...response, headers });
await cache.put(cacheKey, response.clone());
}
return response;
}
};
Supabase Cost Defense Guardrails
Enable Spend Caps: In the Supabase project billing dashboard, keep the 'Spend Cap' toggle turned ON initially. This restricts services from exceeding plan quotas, preventing runaway rogue queries or DDoS attacks from generating massive unexpected invoices.
Vacuum Dead Tuples: Heavy UPDATE workloads generate dead table rows that bloat disk size. Run regular PostgreSQL `VACUUM FULL` during maintenance windows to reclaim disk space before auto-expansion triggers irreversible storage upgrades.
Engineering Q&A: Supabase Billing Optimization
Can Supabase disk size be scaled down after expanding?
No. AWS EBS volumes (which power Supabase disks) do not support automatic volume shrinkage. Once a database expands from 8GB to 50GB, you are billed for 50GB permanently unless you manually dump the database, provision a new project, and restore data.
How does Cloudflare R2 eliminate storage egress costs?
Cloudflare R2 provides S3-compatible object storage with zero egress fees ($0/GB). Storing media assets in R2 or proxying Supabase Storage requests through Cloudflare CDN shields your origin from bandwidth overage fees completely.