Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Neon · Const

Scale to zero

Neon Scale to Zero suspends an inactive Postgres compute after a timeout and resumes it when a query arrives. It reduces compute usage for intermittently used databases, with a brief startup delay on the first query after suspension.

How it works

Neon suspends an inactive Postgres compute after its scale-to-zero timeout, reducing compute charges while the database is unused. A later query automatically resumes the compute, but the first request can experience a brief startup delay. The setting can be changed in compute configuration subject to plan and size limits.

Key points

  • The feature suspends the Postgres compute after inactivity rather than deleting the database or its data.
  • Suspension limits compute billing to periods when the compute is active.
  • A subsequent query triggers automatic reactivation, typically within a few hundred milliseconds.
  • The standard inactivity threshold is 5 minutes.
  • The API expresses the default timeout as 300 seconds.
  • The API's documented minimum timeout is 60 seconds.

Common mistakes

  • Computes larger than 16 CU do not scale to zero and remain active.
  • Free-plan users cannot change the scale-to-zero timeout.

Example: Query a potentially suspended compute

const sql = neon(process.env.DATABASE_URL);

const rows = await sql`SELECT now()`;
console.log(rows);

Run a normal query; if the compute is suspended, Neon resumes it automatically.

When to use it

Reduce idle compute usage

Development and test databases that are idle for long periods.

Lower costs for bursty workloads

Intermittently used production services where a brief cold start is acceptable.

Keep compute always active

Applications that need consistently low latency and can use a paid plan.

Interview questions

QWhat does Neon scale to zero do?

Scale to zero suspends a compute after it has been inactive for the configured period. This lowers compute usage for databases that are not continuously active, and a later query resumes the compute automatically.

Follow-up: What latency trade-off does this create? The first query after suspension can take a few hundred milliseconds longer while the compute starts.

QWhat is the default timeout and API range?

The default inactivity period is 5 minutes, represented by 300 seconds in the API. The documented API range is 60 seconds to 604800 seconds, although plan rules determine which values are available.

Follow-up: Which plan has a fixed value? The Free plan keeps the setting fixed at 5 minutes.

QWhich computes are eligible for scale to zero?

Scale to zero applies only to computes up to 16 CU. Larger computes remain active, so they cannot use this suspension behavior.

Follow-up: Why might a production team disable it? Workloads requiring consistently low latency may avoid cold-start delay by keeping the compute active where the plan permits.

  • Compute lifecycle
  • suspend_timeout_seconds
  • Compute defaults
  • Configuring scale to zero for Neon computes

Source: Scale to Zero. Checked 2026-10-16.