Powering next gen AI apps with Postgres 🚀 Learn More
Manage

Manage computes

A single read-write compute endpoint is created for your project's primary branch, by default.

To connect to a database that resides in a branch, you must connect via a compute endpoint associated with the branch. The following diagram shows the project's primary branch (main) and a child branch, both of which have an associated compute endpoint.

Neon supports both read-write and read-only compute endpoints. Read-only compute endpoints are also referred to as Read replicas. A branch can have a single read-write compute endpoint but supports multiple read-only compute endpoints.

Tier limits define resources (vCPUs and RAM) available to a compute endpoint. The Neon Free Tier provides a shared vCPU and up to 1 GB of RAM per compute endpoint. The Neon Pro plan supports larger compute sizes and Autoscaling.

View a compute endpoint

A compute endpoint is associated with a branch. To view a compute endpoint, select Branches in the Neon Console, and select a branch. If the branch has a compute endpoint, it is shown on the branch page.

Compute endpoint details shown on the branch page include:

  • Id: The compute endpoint ID. -- Type: The type of compute endpoint. R/W (Read-write) or R/O (Read-only).
  • Compute size: The size of the compute endpoint. Neon Pro plan users can configure the amount of vCPU and RAM for a compute endpoint when creating or editing a compute endpoint. Shows Autoscaling minimum and maximum vCPU values if Autoscaling is enabled.
  • Auto-suspend delay: The number of seconds of inactivity after which a compute endpoint is automatically suspended. The default is 300 seconds (5 minutes). For more information, see Auto-suspend configuration.
  • Last active: The date and time the compute was last active.
  • Status: The compute endpoint status (Active, Idle, or Stopped).

Create a compute endpoint

You can only create a read-write compute endpoint for a branch that does not have one, but a branch can have multiple read-only compute endpoints (referred to as "read replicas"). Read replicas are a Neon Pro plan feature.

To create an endpoint:

  1. In the Neon Console, select Branches.
  2. Select a branch that does not have an endpoint
  3. Click Add compute.
  4. On the Create compute endpoint dialog, specify your settings and click Create. Selecting Read-only creates a Read replica.

Edit a compute endpoint

Neon paid plan users can edit a compute endpoint to change the compute size or Auto-suspend configuration.

To edit a compute endpoint:

  1. In the Neon Console, select Branches.
  2. Select a branch.
  3. Click the kebab menu in the Computes table, and select Edit.
  4. Specify your changes and click Save.

Compute size and Autoscaling configuration

Neon Pro plan users can change compute size settings when editing a compute endpoint.

Compute size is the number of Compute Units (CUs) assigned to a Neon compute endpoint. The number of CUs determines the processing capacity of the compute endpoint. One CU has 1 vCPU and 4 GB of RAM, 2 CUs have 2 vCPUs and 8 GB of RAM, and so on. The amount of RAM in GBs is always 4 times the number of CUs, as shown in the table below. Currently, a Neon compute can have anywhere from 1/4 (.25) to 7 CUs.

Compute UnitsvCPURAM
.25.251 GB
.5.52 GB
114 GB
228 GB
3312 GB
4416 GB
5520 GB
6624 GB
7728 GB

Neon supports two compute size configuration options:

  • Fixed Size: This option allows you to select a fixed compute size ranging from .25 CUs to 7 CUs. A fixed-size compute does not scale to meet workload demand.
  • Autoscaling: This option allows you to specify a minimum and maximum compute size. Neon scales the compute size up and down within the selected compute size boundaries to meet workload demand. Autoscaling currently supports a range of 1/4 (.25) to 7 CUs. For information about how Neon implements the Autoscaling feature, see Autoscaling.

info

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

Auto-suspend configuration

Neon's Auto-suspend feature automatically transitions a compute endpoint into an Idle state after a period of inactivity, also known as "scale-to-zero". By default, suspension occurs after 5 minutes of inactivity, but this delay can be adjusted. For instance, you can increase the delay to reduce the frequency of suspensions, or you can disable Auto-suspend completely to maintain an "always-active" compute endpoint. An "always-active" configuration eliminates the few seconds of latency required to reactivate a compute endpoint but is likely to increase your compute time usage.

The maximum Auto-suspend delay setting is 604800 seconds (7 days), and the following settings have a special meaning:

  • 0 means use the default setting (5 minutes / 300 seconds).
  • -1 means never suspend the compute endpoint.

Delete a compute endpoint

Deleting a compute endpoint is a permanent action.

To delete a compute endpoint:

  1. In the Neon Console, select Branches.
  2. Select a branch.
  3. Click the kebab menu in the Computes table, and select Delete.
  4. On the confirmation dialog, click Delete.

Manage compute endpoints with the Neon API

Compute endpoint actions performed in the Neon Console can also be performed using the Neon API. The following examples demonstrate how to create, view, update, and delete compute endpoints using the Neon API. For other compute endpoint API methods, refer to the Neon API reference.

note

The API examples that follow may not show all of the user-configurable request body attributes that are available to you. To view all attributes for a particular method, refer to method's request body schema in the Neon API reference.

The jq option specified in each example is an optional third-party tool that formats the JSON response, making it easier to read. For information about this utility, see jq.

Prerequisites

A Neon API request requires an API key. For information about obtaining an API key, see Create an API key. In the cURL examples below, $NEON_API_KEY is specified in place of an actual API key, which you must provide when making a Neon API request.

Create a compute endpoint with the API

The following Neon API method creates a compute endpoint.

The API method appears as follows when specified in a cURL command. The branch you specify cannot have an existing compute endpoint. A compute endpoint must be associated with a branch, and a branch can have only one compute endpoint. Neon supports read-write and read-only compute endpoints. Read-only compute endpoints are for creating Read replicas. A branch can have a single read-write compute endpoint but supports multiple read-only compute endpoints.

Response body

List compute endpoints with the API

The following Neon API method lists compute endpoints for the specified project. A compute endpoint belongs to a Neon project. To view the API documentation for this method, refer to the Neon API reference.

The API method appears as follows when specified in a cURL command:

Response body

Update a compute endpoint with the API

The following Neon API method updates the specified compute endpoint. To view the API documentation for this method, refer to the Neon API reference.

The API method appears as follows when specified in a cURL command. The example reassigns the compute endpoint to another branch by changing the branch_id. The branch that you specify cannot have an existing compute endpoint. A compute endpoint must be associated with a branch, and a branch can have only one compute endpoint.

Response body

Delete a compute endpoint with the API

The following Neon API method deletes the specified compute endpoint. To view the API documentation for this method, refer to the Neon API reference.

The API method appears as follows when specified in a cURL command.

Response body

Need help?

Send a request to support@neon.tech, or join the Neon community forum.

Edit this page
Was this page helpful?