Project resource quotas Innovation Release

A resource quota sets an upper limit on the CPU, memory, and storage that the resources in a project can use in Hybrid Manager (HM). Use quotas to keep one project from using more than its share of the capacity of your HM instance.

Only Organization Owners can set quotas.

How quotas work

A quota applies to a single project. You can set a limit for each of these resources:

ResourceWhat the limit capsExample values
CPUCores, including fractions of a core6 or 500m
MemoryMemory6Gi
StoragePrimary and write-ahead log (WAL) volumes50Gi

Each limit is optional. If you don't set a limit for a resource, HM doesn't restrict it. A project with no limits behaves as it did before quotas existed. A limit must be greater than zero.

What counts toward a quota

A quota counts the resources allocated to the following in the project:

  • Postgres clusters, including all of their nodes and replicas
  • Applications deployed from the marketplace

When you delete a resource, HM releases its share of the quota. Backup and snapshot storage doesn't count toward a quota.

Where quotas are enforced

HM checks the quota of a project when you do any of the following:

  • Create, edit, or scale a cluster — If the request would exceed a limit, HM rejects it with an HTTP 400 error that names each resource over its limit.
  • Deploy an application — If the deployment would exceed a limit, the deploy task fails with a quota message.
  • Use autoscaling — HM checks scale-ups of CPU, memory, and disk against the quota and refuses any that would exceed a limit. Scale-downs always succeed. If the quota blocks autoscaling repeatedly, HM pauses the automation for a cooldown period. After an Organization Owner raises the quota, the next autoscaling attempt can succeed.
  • Set or edit a quota — HM rejects a limit that's lower than the project's current usage. Resources that are already running aren't stopped or reduced.

Quotas and multiple locations

A project has one quota, regardless of how many locations it uses. HM adds up the resources of the project across all locations and checks the total against the quota. A request that creates resources in several locations, such as a distributed high-availability (DHA) cluster, is accepted or rejected as a whole.

A quota is a ceiling, not a reservation. Each location also has its own resource limits, and a request must fit within both the project quota and the limits of the target location. The error message tells you which limit the request exceeded.

Setting or editing a quota

You need the Organization Owner role to set or edit a quota.

  1. From the user menu at the top right of the HM console, select Settings.
  2. Select the Quota tab.
  3. In the row for the project, select the edit icon in the Actions column.
  4. Enter a limit for each resource that you want to cap. Leave a resource unset if you don't want to limit it.
  5. Save your changes.

If you enter a limit that's lower than the project's current usage, HM rejects the change and lists each resource that's over the new limit. Delete or scale down resources in the project, and then set the lower limit.

Viewing usage against a quota

On the Quota tab, the summary tiles show Total Projects and the total CPU Usage, Memory Usage, and Storage Usage across projects. Below the tiles, a table lists each project with its current allocation of each resource. If the project has a limit, the table shows the allocation against the limit and a progress bar. If the project has no limit, the table shows No limit.

Quota API

Project owners and editors can view the quota usage of their own project, broken down by location, by using the API. Organization Owners can also set and read quotas for any project. The following endpoints are available:

EndpointWhat it doesWho can call it
PATCH /api/v1/quota-allocationsSets, merges, or resets a quotaOrganization Owner
GET /api/v1/quota-allocations?projectId=<project_id>Reads the quota of one projectOrganization Owner
GET /api/v1/quota-usagesLists the quota usage for all projectsOrganization Owner
GET /api/v1/projects/{project_id}/quota-usagesReads the quota usage of one projectProject owner or editor

In these endpoints, project_id is the ID of the project. A project ID looks like prj_… and appears in the URL of the project in the HM console.

Quantities use Kubernetes units, such as 6, 500m, and 6Gi. An empty string removes a limit.

The usage response includes an overQuota field. It's true when the usage of a project is above its quota.

Quota errors

When a request exceeds a quota, the error identifies the resource, the limit, the amount in use, and the amount requested. For example, creating a cluster that asks for more memory than the project has left returns an HTTP 400 error with a message similar to:

cannot create cluster: memory quota exceeded (limit 2Gi, in use 1Gi, requested 4Gi)

The error also includes a QuotaViolations detail. It lists each resource that exceeded its limit, with the name, need, limit, and used values for that resource.

To resolve the error, either reduce the resources that the request asks for, free up resources in the project, or ask an Organization Owner to raise the quota.

Quota events in the activity log

The activity log records these quota-related events:

  • A quota is updated, including the previous and new values and who made the change.
  • A cluster creation is rejected because it would exceed a quota.
  • Autoscaling skips a scale-up because it would exceed a quota.