配额和限制

Service Directory 使用配额和系统限制来维持公平的资源分配、防止服务过载并帮助您管理资源使用情况。

配额和系统限制类似,但在以下方面有所不同:

  • 配额具有默认值,但您通常可以申请调整。
  • 系统限制是无法更改的固定值。

如需更改配额,请参阅申请额外的配额。

Google Cloud 使用配额来帮助维持公平性并减少资源使用和可用性的激增。配额用于限制您的 Google Cloud 项目可使用多少Google Cloud 资源。配额适用于一系列资源类型,包括硬件、软件和网络组件。例如,配额可以限制对某项服务的 API 调用次数、您的项目并发使用的负载均衡器数量或者您可以创建的项目数量。配额可以防止服务过载,从而保护Google Cloud 用户社区。配额还可以帮助您管理自己的 Google Cloud 资源。

Cloud 配额系统执行以下操作:

在大多数情况下,当您尝试消耗的资源超出其配额允许的范围时,系统会阻止对资源的访问,并且您尝试执行的任务会失败。

配额通常在 Google Cloud 项目级别应用。您在一个项目中使用资源不会影响您在另一个项目中的可用配额。在 Google Cloud 项目中,配额在所有应用和 IP 地址间共享。

如需了解详情,请参阅 Cloud 配额概览。

Service Directory 资源也有系统限制。系统限制不能更改。

配额

Service Directory 的配额如下:

  • 每个区域每个项目的命名空间数量
  • 每个命名空间的服务数量
  • 每项服务的端点数量
  • 每个区域每分钟的注册请求数
  • 每个区域每分钟的查找请求数

您可以在配额页面上查看现有配额和用量。

限制

Service Directory 的一般限制:

  • 没有端点的健康状况或健康检查。有两个备选方式:
    • 使用内部负载均衡器进行集成式健康检查,并向 Service Directory 注册该负载均衡器。
    • 在 Service Directory 中将各个端点的健康状态存储为端点注解。

Cloud DNS 集成限制:

  • Cloud DNS 集成仅处理地址为有效 IPv4 或 IPv6 地址的端点。所有没有有效 IP 地址的已注册端点都会被 DNS 请求忽略。
  • SRV 记录不能自定义。符号服务、协议、TTL、权重及优先级由 Service Directory 管理。
  • DNS 请求中不提供服务和端点注解。如果您的服务需要使用自定义注解,则应使用 Service Directory 中的 HTTP 支持。
  • 您不能将资源记录添加到 Service Directory 可用区中。只允许添加从现有的 Service Directory 端点内部生成的资源记录。

Manage quotas

Service Directory enforces quotas on resource usage for various reasons. For example, quotas protect the community of Google Cloud users by preventing unforeseen spikes in usage. Quotas also help users who are exploring Google Cloud with the free tier to stay within their trial.

All projects start with the same quotas, which you can change by requesting additional quota. Some quotas might increase automatically based on your use of a product.

Permissions

To view quotas or request quota increases, Identity and Access Management (IAM) principals need one of the following roles.

Task Required role
Check quotas for a project One of the following:
Modify quotas, request additional quota One of the following:
  • Project Owner (roles/owner)
  • Project Editor (roles/editor)
  • Quota Administrator (roles/servicemanagement.quotaAdmin)
  • A custom role with the serviceusage.quotas.update permission

Check your quota

Console

  1. In the Google Cloud console, go to the Quotas page.

    Go to Quotas

  2. To search for the quota that you want to update, use the Filter table. If you don't know the name of the quota, use the links on this page instead.

gcloud

Using the Google Cloud CLI, run the following command to check your quotas. Replace PROJECT_ID with your own project ID.

    gcloud compute project-info describe --project PROJECT_ID

To check your used quota in a region, run the following command:

    gcloud compute regions describe example-region
    

Errors when exceeding your quota

If you exceed a quota with a gcloud command, gcloud outputs a quota exceeded error message and returns with the exit code 1.

If you exceed a quota with an API request, Google Cloud returns the following HTTP status code: 413 Request Entity Too Large.

Request additional quota

To adjust most quotas, use the Google Cloud console. For more information, see Request a quota adjustment.

Resource availability

Each quota represents a maximum number for a particular type of resource that you can create, if that resource is available. It's important to note that quotas don't guarantee resource availability. Even if you have available quota, you can't create a new resource if it is not available.

For example, you might have sufficient quota to create a new regional, external IP address in a given region. However, that is not possible if there are no available external IP addresses in that region. Zonal resource availability can also affect your ability to create a new resource.

Situations where resources are unavailable in an entire region are rare. However, resources within a zone can be depleted from time to time, typically without impact to the service level agreement (SLA) for the type of resource. For more information, review the relevant SLA for the resource.