---
title: "Using Neon’s Scale to Zero with Long-Running Applications"
description: "Neon's scale to zero suspends a Postgres compute after an idle window (only when no WAL senders are active and autovacuum isn't running), which severs connections held by long-running servers."
url: "https://swe.quest/articles/using-neon-s-scale-to-zero-with-long-running-applications-bbe64dd8466d86d8"
canonical: "https://neon.com/blog/using-neons-auto-suspend-with-long-running-applications"
source: "Neon"
published: "2024-01-24"
difficulty: "medium"
kind: "How-to"
reading_minutes: 7
tags: ["postgres","serverless","resilience","javascript","performance"]
---

# Using Neon’s Scale to Zero with Long-Running Applications

A post on [Neon](https://swe.quest/sources/neon.md), published 2024-01-24, 7 min read, How-to. Original: [https://neon.com/blog/using-neons-auto-suspend-with-long-running-applications](https://neon.com/blog/using-neons-auto-suspend-with-long-running-applications)

## Summary

Neon's scale to zero suspends a Postgres compute after an idle window (only when no WAL senders are active and autovacuum isn't running), which severs connections held by long-running servers. A naive node-postgres Client crashes on the resulting unhandled error event. A client-side pg.Pool with an error handler tolerates the dropped connections and reconnects on demand, waking the database. In Apache Bench tests the pool beat per-request connections by more than 10x (about 46ms vs 678ms average latency, 370 vs 26 req/s), with the same pattern shown in a Fastify, Drizzle and HTMX example app.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Serverless](https://swe.quest/tags/serverless.md) (Backend & APIs)
- [Resilience](https://swe.quest/tags/resilience.md) (Distributed systems)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)

## Prerequisites

- Postgres connections ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- Node.js async code ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))
- connection pooling basics

## Keywords

Neon, node-postgres, PgBouncer, Fastify, Drizzle ORM, HTMX, Apache Bench

## Related posts

- [How Neon's lakebase architecture stays resilient to cloud failures](https://swe.quest/articles/how-neon-s-lakebase-architecture-stays-resilient-to-cloud-failures-af12630b54b66e1b.md): Neon · 2026-05-27 · Medium · 9 min read · Resilience, PostgreSQL, SRE, Chaos engineering, System design
  Neon (and Databricks Lakebase) hardens its serverless Postgres against cloud failures by keeping Postgres compute stateless over zone-redundant storage, so failed computes are replaced instantly without hot standbys or WAL replay.
- [Quicker serverless Postgres connections](https://swe.quest/articles/quicker-serverless-postgres-connections-7a37a1071edd4362.md): Neon · 2023-03-28 · Medium · 8 min read · PostgreSQL, Networking, Serverless, Performance engineering, Cryptography
  Neon cut the network round-trips needed to get a first query result from its WebSocket-based serverless Postgres driver from nine to four.
- [Let Your AWS Lambdas Survive Thousands of Connections](https://swe.quest/articles/let-your-aws-lambdas-survive-thousands-of-connections-95ac0e1f5340c6dd.md): Neon · 2024-12-02 · Medium · 13 min read · Serverless, PostgreSQL, Cloud platforms, JavaScript, Scaling
  Lambda's per-instance database connections can overwhelm Aurora Serverless v2 during traffic spikes, causing connection exhaustion, lingering zombie connections and cold-start latency, and RDS Proxy adds cost, pinning issues and borrow latency without fully fixing it.
- [Cold starts just got hot](https://swe.quest/articles/cold-starts-just-got-hot-2fb157f3acc4ca83.md): Neon · 2023-07-25 · Medium · 7 min read · Serverless, PostgreSQL, Performance engineering, System design
  Neon cut serverless Postgres compute cold starts from 3-6 seconds to roughly 500 ms by skipping work and reframing the problem.
- [How Shipsidekick replaced Neon with ClickHouse Managed Postgres for 10x faster queries and better reliability](https://swe.quest/articles/how-shipsidekick-replaced-neon-with-clickhouse-managed-postgres-for-10x-faster-4525525384ac6471.md): ClickHouse · 2026-10-23 · Medium · 8 min read · PostgreSQL, Databases, Performance engineering, Serverless
  Shipsidekick, a logistics platform built on Next.js and Vercel, moved its Postgres database from Neon to ClickHouse Managed Postgres after repeated outages.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
