限制和配额

请按照本指南了解使用 Data Manager API 时的限制和配额。

项目限制

您需要一个 Google Cloud 项目才能使用 Data Manager API。Google Cloud 项目提供您用于验证 API 请求的 OAuth 客户端和凭据。

数据管理器 API 会针对每个 Google Cloud 项目强制执行速率限制,并按服务和操作类型(读取与变异)进行区分:

服务 操作 每日请求数 每分钟请求数
IngestionService 更改(写入) 100000 300
IngestionService 读取 100000 300
所有其他服务总计 更改(写入) 5 万 300
所有其他服务总计 读取 5 万 300

超出限制的请求会被拒绝,并返回错误 RESOURCE_EXHAUSTED 和 HTTP 状态 429 Too Many Requests。

您可以主动减少请求数量并从客户端限制 QPS,从而掌控应用并缓解速率限制。您还可以在 Google Cloud 控制台中设置配额提醒和监控,以便在应用达到限制之前收到通知。

配额名称

每个限制都对应于 Google Cloud 中的配额限制名称和指标。当请求超出限制时,Data Manager API 会在 metadata.quota_limit 下的 ErrorInfo 标准详细信息载荷中返回配额限制名称:

配额限制名称 服务 操作 窗口 限制
IngestionMutateRequestsPerDayPerProject IngestionService mutate 日 100000
IngestionMutateRequestsPerMinutePerProject IngestionService mutate 分钟 300
IngestionReadRequestsPerDayPerProject IngestionService 读取 日 100000
IngestionReadRequestsPerMinutePerProject IngestionService 读取 分钟 300
ManagementMutateRequestsPerDayPerProject 所有其他服务 mutate 日 5 万
ManagementMutateRequestsPerMinutePerProject 所有其他服务 mutate 分钟 300
ManagementReadRequestsPerDayPerProject 所有其他服务 读取 日 5 万
ManagementReadRequestsPerMinutePerProject 所有其他服务 读取 分钟 300

检查 ErrorInfo 载荷中的 metadata.quota_limit,以区分每日限额错误和每分钟限额错误,并确定是暂时暂停并使用退避重试,还是暂停直到每日配额重置。如需了解详情,请参阅配额和速率限制错误。

请求限制

以下是针对特定请求的限制: