Powering next gen AI apps with Postgres 🚀 Learn More
Guides/Neon features

Configuring Auto-suspend for Neon computes

Learn how to configure Neon's Auto-suspend feature to control when your compute scales to zero

Neon's Auto-suspend feature controls when a Neon compute instance transitions to an Idle state (scales to zero) due to inactivity. This guide demonstrates how to configure the Auto-suspend setting in your Neon project.

You can configure the Auto-suspend setting in an existing project by editing a compute endpoint. You can also configure it when you first create a Neon project, which sets the Auto-suspend default for the project. Both methods are described below.

Configure Auto-suspend for a compute endpoint

Neon Pro plan users can edit an individual compute endpoint to adjust the Auto-suspend configuration.

To edit a compute endpoint:

  1. In the Neon Console, select Branches.

  2. Select a branch.

  3. Click the compute endpoint kebab menu, and select Edit. Edit compute endpoint menu

  4. Under Compute size, enter the desired Auto-suspend delay setting. The value is specified in seconds. The maximum setting is 604800 seconds (7 days). A value of 0 is equivalent to the global default value of 300 seconds (5 minutes). A value of -1 turns off the Auto-suspend feature, which means that the compute remains active.

    note

    You can configure Autoscaling settings for your compute endpoint at the same time. For more information, see Enable Autoscaling in Neon.

  5. Click Save.

Set the Auto-suspend default when creating a project

A project is a top-level object in the Neon object hierarchy. You can think of it as a container for all other objects, including branches and compute endpoints.

Enabling Auto-suspend when you create a project allows you to set the Auto-suspend default setting for all compute endpoints created in your project. You can adjust Auto-suspend setting for individual compute endpoints afterward, but setting a default when creating a project saves you from having to configure this setting for each compute later on.

To configure the Auto-suspend default setting at project creation time:

  1. Navigate to the Neon Console.

  2. If you are creating your very first project, click Create a project. Otherwise, click New Project.

  3. Specify a name, a Postgres version, and a region.

  4. Under Compute size, enter the desired Auto-suspend delay setting.

    note

    You can configure default Autoscaling settings at the same time. For more information, see Enable Autoscaling in Neon.

  5. Click Save.

  6. Click Create Project. Your initial compute endpoint is created with the specified setting. All compute endpoints created in the future when creating a branch or adding a compute endpoint to a branch are created with this setting.

Monitor compute status

You can monitor compute status on the Branches page in the Neon Console. A compute reports either an Active or Idle status.

Compute endpoint status

You can also view compute state transitions in the Branches widget on the Neon Dashboard.

User actions that activate an idle compute include connecting from a client such as psql, running a query on your database from the Neon SQL Editor, or accessing the compute via the Neon API.

info

The Neon API includes Start endpoint and Suspend endpoint APIs for the specific purpose of activating and suspending a compute.

You can try any of these methods and watch the status of your compute as it transitions from an Idle to an Active state.

Edit this page
Was this page helpful?