Working with quotas

Google Cloud enforces quotas on resource usage for project owners, setting a hard limit on how much of a particular Google Cloud resource your project can use. Quotas fall under two categories:

  • Rate quotas, such as the number of API requests per day. This quota resets after a time interval that is specific to the service, such as a minute or a day.
  • Allocation quotas, such as the number of virtual machines or load balancers used by your project at a given time. This quota does not reset over time, but must be explicitly released when you no longer want to use the resource (for example, by deleting a GKE cluster).

Each quota limit represents a specific countable resource, such as API requests per day to the number of load balancers used concurrently by your application.

Quotas are enforced for a variety of reasons:

  • To protect the community of Google Cloud users by preventing unforeseen spikes in usage.
  • To help you manage resources. For example, you can set your own limits on service usage while developing and testing your applications.

Different projects may have the different quotas for the same services. For example, if you are using a free trial account to explore the platform, your quotas are more limited. Enabling billing for your project increases quotas for most services; you can also explicitly request more quota for a specific service. Quotas may also increase as your use of Google Cloud expands over time.

Quota limits in your project may be affected by quota overrides applied by the service owner, project owner, or quota administrator; you can learn more about how quota limits are calculated in the Service quota model.

You can configure monitoring and alerts to track quota usage and alert you in the event of quota expiration or unusual usage.

This page describes how to work with quotas in your projects, including how to find and modify your existing quota limits, how to request higher quota, and how to monitor quota usage. You can find out how to view other API usage metrics in Monitoring your API usage.

Permissions

You need the following IAM permissions to view your project quota in the Google Cloud Console or access it programmatically:

  • resourcemanager.projects.get
  • resourcemanager.folders.get (if you want to view quota for an entire Folder)
  • resourcemanager.organizations.get (if you want to view quota for an entire Organization)
  • serviceusage.quotas.get

You can see which roles include these permissions by default in the IAM permissions reference.

To change quotas at the project, folder, or organization level, you also need the following permission:

  • serviceusage.quotas.update

This permission is included by default for the following roles: Owner, Editor, Quota Administrator, and Service Usage Admin.

Viewing your quota

You can view your current quota limits in two different areas of the Google Cloud Console:

  • The Quotas page, which lists all quota usage and limits for your project.
  • The Cloud Console API dashboard, which lists quota information for a particular API, including resource usage over time.

You can manage quota usage programmatically with the Service Usage API.

In addition, some services offer command-line access to quota and resource usage information. For example, Compute Engine lets you access quota information with gcloud compute.

You can find out how to monitor your quota usage and how to set quota alerts in the section Monitoring quota metrics.

Viewing all project quotas

To view quota usage and limits for all resources in your project:

  1. Go to the (Cloud Console Quotas page in IAM & admin, which lists one line item for each type of quota available in each service.

  2. Sort and filter the results to focus on the information you need:

    • To view a specific property, click Filter table.
    • To sort the lists alphabetically, hold the pointer over Service, Limit name, Quota status, or Details.
    • By default, the list is sorted to show your most used quota first (in terms of peak usage over the last seven days), helping you to see limits that are at risk of being exceeded. To view the least used first, toggle the Quota status arrow.
    • To learn more about your Current Usage of a particular quota, click All Quotas in the Details column.

The quotas usage metrics listed on the Quotas page are calculated as follows:

  • Rate quotas:
    • For day-rate quotas, the number listed represents the total usage so far in the current 24-hour period.
    • For per-minute or per-100-seconds quota, the number listed represents the average usage in the past 24 hours.
  • Allocation quotas: The number listed represents the resource quantity (such as the number of load balancers) currently being used by your project.

You can find out more about quotas for a specific service and what they mean in their own documentation. For example, Compute Engine quota is documented in Resource Quotas.

API-specific quota

To view more detailed quota information for a particular API, including usage over time, visit the API's quota page in the Cloud Console. Depending on the API, these limits may include requests per day, requests per minute, and requests per minute per user. Some APIs set very low limits until you enable billing on your project.

You can view the current limits for a particular API in two different areas of the Cloud Console:

  • On the Cloud Console Quotas page as described in the Viewing all project quotas section.

  • On the Cloud Console APIs & Services Dashboard page. On this page, select your project, click the API name, and then click Quotas. The Quotas page shows the quota names for the API. You can expand each quota to see detailed usage over time, as well as your current limit. By default, the limits displayed are those imposed by Google. You can cap usage as described in the Capping usage section. If there is no Google-imposed limit on a given quota, the limit is displayed as Unlimited.

    • Some quotas do not appear on an API-specific quota page. For example, requests to the Compute Engine API have an API-specific quota page, but this doesn't include Compute Engine compute resource usage (allocation quota). In addition, if you are using a service in multiple locations, the API-specific quota page does not show regional or zonal quota limits and their usage. For a complete list of your project's quota usage that you can filter by location, see the project Quotas page.

Managing your quota using the Cloud Console

Depending on your resource usage, you may want to adjust your project's quota limits up or down. This section describes how to change your provided quota limits. You can see your quota limits by clicking ALL QUOTAS in the Details column.

Requesting higher quota

You can request a quota change for most billable services with a quota limit on the Cloud Console Quotas page.

  1. In the Quota status column, click warning. The quota panel lists all of your quotas.
  2. Select the checkbox for the location of the quota you want to change.
  3. Click EDIT QUOTAS.
  4. Complete the request form.
  5. Enter your revised quota limit, and optionally, a description.
  6. Click DONE.
  7. Click SUBMIT REQUEST.

Alternatively, click Filter table to query your quota by a specific property.

You will receive an email in response to your request.

Google Cloud quota requests are usually processed quickly, within two business days and confirmed with an email from Google Cloud. If you need further assistance, you can respond to that email. Note that large quota changes require longer to approve.

Capping usage

You might want to limit usage of a particular resource by setting your own quota limits. For example, to prevent getting billed for usage beyond the free courtesy usage limits, you can request per-day caps. The simplest way to cap quota is to edit the limits on the API-specific quota page.

In the Google Cloud Console, go to Quotas on the IAM & Admin page.

Go to Quotas

  1. Click Filter table to query your quota by a specific property.
  2. Click ALL QUOTAS for the usage you want to cap.
  3. Click the checkbox to select the property you want to edit.
  4. Click EDIT QUOTAS.
  5. Complete the request form.
  6. Enter your revised quota limit, and optionally, a description.
  7. Click DONE.
  8. Click SUBMIT REQUEST.

If you want to cap a quota that doesn't appear on this page, or set a limit higher than the provided maximum, then edit your limits as described in Requesting higher quota.

Managing your quota using the Service Usage API

You can use the Service Usage APIs to get current quotas and limit the quota usage for some Google Cloud APIs and services. For more information about Service Usage, see the following:

You cannot use the Service Usage API to request a higher quota. For this activity, you must use the Cloud Console.

Monitoring and alerting on quota metrics

The Cloud Monitoring API and UI allows you to monitor quota usage, limits, and errors in greater depth. You can use these metrics to create custom dashboards and alerts, letting you monitor quota usage over time and receive alerts when, for example, you are approaching a quota limit.

Cloud Monitoring supports a wide variety of metrics that you can combine with filters and aggregations for new and insightful views into your quota usage. For example, you can combine a metric for allocation quota usage with a quota_metric filter on Cloud TPU names.

{ % include "monitoring/_shared/metrics-explorer/_template_metrics_explorer.html" %}

Similarly, to see quota limits or exceeded errors, first select Consumer Quota as the resource type and then select Quota limit or Quota exceeded error.

After you've found the quota usage information you want, you can use Cloud Monitoring to create custom dashboards and alerts to help you monitor and maintain a robust application. You can learn more in the following pages:

See Using quota metrics in the Cloud Monitoring documentation to find out more, with examples of common quota-specific alerting policies.

You can find a detailed reference for quota metrics in the Cloud Monitoring reference guide.

Quota errors

If your project exceeds a quota while using a service, Google Cloud returns an error based on how you accessed the service:

  • If you exceeded a quota with a HTTP/REST request, Google Cloud returns an HTTP 429 TOO MANY REQUESTS status code.
  • If you exceed a quota with an API request, Google Cloud returns an HTTP 413 REQUEST ENTITY TOO LARGE status code.
  • If you exceeded a quota using gRPC, Google Cloud returns a ResourceExhausted error. How this error appears to you depends on the service.
  • If you exceeded a quota using a gcloud command-line tool command, gcloud command-line tool outputs a quota-exceeded error message and returns with the exit code 1.

Rate quotas reset after a predefined time interval specific to each service. Refer to the quotas documentation for specific service(s) for more detailed information.

You can identify the quota usage associated with an error alert using Cloud Monitoring, and create custom alerts for specific quota errors, as described in Monitoring quota metrics.