Supabase Auto-Pause - Free Tier Limits and Health Checks That Actually Write
Supabase Auto-Pause and Health Checks That Actually Write
If you are using Supabase's free tier for a side project or MVP, you have hit this: your database goes to sleep after a period of inactivity. When the next request comes in, there is a cold start delay. Or worse, the connection fails entirely and your app shows an error.
The Auto-Pause Problem
Supabase free tier projects pause after 7 days of inactivity. This is reasonable - they are providing free infrastructure and need to manage resources. But it means your always-on AI agent or background service suddenly cannot reach its database.
The naive fix is a health check - a cron job that pings the database every few hours. But a SELECT query might not be enough. Some auto-pause systems track write activity specifically, not just connections.
Health Checks That Write
The reliable fix is a health check that performs an actual write operation. Create a health_checks table and insert a timestamp every few hours. This ensures the database sees real activity, not just connection pings.
INSERT INTO health_checks (checked_at) VALUES (NOW());
DELETE FROM health_checks WHERE checked_at < NOW() - INTERVAL '7 days';
The delete keeps the table from growing forever. The insert keeps the database active. Run this every 4-6 hours and auto-pause becomes a non-issue.
Connection Limits
Free tier also has connection limits. If your AI agent opens connections and does not close them properly, you hit the ceiling fast. Use connection pooling, close connections explicitly, and set timeouts.
For agent workloads that are bursty - many connections during active use, zero during downtime - Supabase's pooler mode helps. It multiplexes multiple client connections over fewer database connections.
The free tier is genuinely useful for MVPs and side projects. Just plan for its constraints instead of discovering them in production at 2 AM.
Fazm is an open source macOS AI agent. Open source on GitHub.