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

Neon · Const

Suspend timeout

suspend_timeout_seconds sets the inactivity delay before a Neon compute scales to zero. The default is 300 seconds; supported plans can customize it, disable suspension with -1, or use 0 for the plan default.

How it works

suspend_timeout_seconds controls how long a compute endpoint may remain inactive before Neon scales it to zero. Use zero for the plan default, a positive number for a custom delay, or negative one to keep the endpoint from suspending; the permitted range depends on the plan.

Syntax

"suspend_timeout_seconds": <integer>

Parameters

NameTypeDescription
suspend_timeout_secondsinteger, optional, int64Scale-to-zero idle timeout in seconds before the compute suspends; 0 uses the plan default and -1 disables scale-to-zero.

Key points

  • Neon's default inactivity threshold is 300 seconds, or five minutes.
  • A longer timeout can reduce the frequency of cold starts, with a documented upper bound of seven days.
  • Scale plan users can choose a timeout as short as 60 seconds.

Common mistakes

  • Ongoing connection activity can keep resetting the inactivity timer, so the configured timeout is not a guarantee that suspension will occur at that moment.

Example: Set a 10-minute suspend timeout

curl --request PATCH \
  --url https://console.neon.tech/api/v2/projects/$PROJECT_ID/endpoints/$ENDPOINT_ID \
  --header "authorization: Bearer $NEON_API_KEY" \
  --header "content-type: application/json" \
  --data '{"endpoint":{"suspend_timeout_seconds":600}}'

Sets the endpoint to suspend after 10 minutes of inactivity.

When to use it

Prioritize responsiveness

Reduce cold starts for an intermittently used application by keeping its compute active longer.

Prioritize cost savings

Lower compute costs for development or low-traffic environments by allowing faster scale-to-zero.

Avoid automatic suspension

Keep a production compute continuously available when the plan supports disabling scale-to-zero.

Interview questions

QWhat does suspend_timeout_seconds control?

suspend_timeout_seconds is the inactivity duration, measured in seconds, before a compute scales to zero. A value of 0 selects the plan default, while -1 disables scale-to-zero.

Follow-up: What limits apply to custom values? The minimum depends on the plan, and the documented maximum is 604800 seconds, or one week.

QWhat are the default and special values?

The default timeout is 300 seconds, equivalent to five minutes. A custom positive value changes how long an idle compute remains available before suspension.

Follow-up: How would you preserve an always-on endpoint? Set the value to -1, which disables scale-to-zero, subject to the plan's capabilities.

QHow can the timeout be configured through the API?

Send a PATCH request to the endpoint update API with the endpoint ID and a body containing suspend_timeout_seconds. The project ID and compute endpoint ID identify the resource being changed.

Follow-up: What operational detail matters after the PATCH? The client should wait for the current operation to finish before using the endpoint.

  • scale to zero
  • compute endpoint
  • autoscaling_limit_min_cu
  • autoscaling_limit_max_cu
  • Update compute endpoint API

Source: Connection latency and timeouts - Neon Docs. Checked 2026-10-16.