Neon is now SOC 2 Type 2 compliant 🚀Read more
Guides/Neon features

Enable Autoscaling in Neon

Learn how to enable Neon's Autoscaling feature to automatically scale compute resources on demand

Neon's Autoscaling feature dynamically adjusts the amount of compute resources allocated to a Neon compute endpoint in response to the current workload, eliminating the need for manual intervention. This guide demonstrates how to enable Autoscaling in your Neon project.

Autoscaling is a Neon Pro Plan feature. Neon Pro Plan users can enable Autoscaling for a new project, for an existing project, or for an individual compute endpoint. Autoscaling is supported with both read-write and read-only compute endpoints. Read-only compute endpoints enable Neon's Read replica feature.

Enable Autoscaling for a new project

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

To enable Autoscaling when you first create your project:

  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, select the Autoscaling option.

  5. Using the slider, specify a minimum and maximum compute size. Autoscaling

    note

    You can configure the Auto-suspend setting for your compute endpoint at the same time. The Suspend compute after a period of inactivity setting defines the period of inactivity after which a compute endpoint is automatically suspended. This feature is also referred to as "scale-to-zero".

  6. Click Create Project. Your initial compute endpoint is created with the specified settings. All future compute endpoints that you create will use this setting.

Enable Autoscaling for an existing project

Configuring the Autoscaling setting for an existing project sets the project's default, which is applied to all compute endpoints created from that point forward. Existing compute endpoints are unaffected. You can adjust Autoscaling default or configure the setting for individual compute endpoints later, as necessary.

To configure Autoscaling default settings for an existing project:

  1. Select a project in the Neon console.

  2. On the Neon Dashboard, select Settings.

  3. Select Compute and click Change.

  4. Under Compute size, select the Autoscaling option.

  5. Using the slider, specify a minimum and maximum compute size. Autoscaling

    note

    You can configure the Auto-suspend setting for your compute endpoint at the same time. The Suspend compute after a period of inactivity setting defines the period of inactivity after which a compute endpoint is automatically suspended. This feature is also referred to as "scale-to-zero".

  6. Click Save.

Enable Autoscaling for a compute endpoint

Neon Pro Plan users can edit an individual compute endpoint to alter the compute endpoint configuration, which includes Autoscaling.

To edit a compute endpoint:

  1. In the Neon Console, select Branches.

  2. Select a branch.

  3. Click on the compute endpoint you want to edit. Edit compute endpoint menu

  4. Under Compute size, select the Autoscaling option.

  5. Using the slider, specify a minimum and maximum compute size. Autoscaling edit settings

    Neon scales the compute size up and down within the specified range to meet workload demand. Autoscaling currently supports a range of 1/4 (.25) to 7 vCPUs. One vCPU has 4 GB of RAM, 2 vCPUs have 8 GB of RAM, and so on. The amount of RAM in GB is always 4 times the number of vCPUs.

    note

    You can configure the Auto-suspend setting for your compute endpoint at the same time. The Suspend compute after a period of inactivity setting defines the period of inactivity after which a compute endpoint is automatically suspended. This feature is also referred to as "scale-to-zero".

  6. Click Save.

Monitor Autoscaling

The neon_utils extension provides a num_cpus() function for monitoring how the Autoscaling feature allocates compute resources in response to workload. For more information, see The neon_utils extension.

Last updated on

Edit this page
Was this page helpful?