本文档列出了适用于 Media CDN 的配额和系统限制。
- 配额具有默认值,但您通常可以申请调整。
- 系统限制是无法更改的固定值。
Google Cloud 使用配额来帮助确保公平性并减少资源使用和可用性的激增。配额用于限制您的 Google Cloud 项目可使用多少Google Cloud 资源。配额适用于一系列资源类型,包括硬件、软件和网络组件。例如,配额可以限制对某项服务的 API 调用次数、您的项目并发使用的负载均衡器数量或者您可以创建的项目数量。配额可以防止服务过载,从而保护Google Cloud 用户社区。配额还可以帮助您管理自己的 Google Cloud 资源。
Cloud 配额系统执行以下操作:
在大多数情况下,当您尝试消耗的资源超出其配额允许的范围时,系统会阻止对资源的访问,并且您尝试执行的任务会失败。
配额通常在 Google Cloud 项目级别应用。您在一个项目中使用资源不会影响您在另一个项目中的可用配额。在 Google Cloud 项目中,配额在所有应用和 IP 地址间共享。
如需了解详情,请参阅 Cloud 配额概览。
Media CDN 资源也有系统限制。系统限制不能更改。
配额
以下配额适用于 Media CDN。如果您需要更高的配额,请与您的 Google Cloud 销售团队联系并请求调整。如需了解详情,请参阅申请配额调整。
配置
| 项 | 默认配额 |
|---|---|
每个项目的 EdgeCacheService 资源数上限 |
20 |
每个项目的 EdgeCacheOrigin 资源数上限 |
30 |
每个项目的 EdgeCacheKeyset 资源数上限 |
10 |
系统限制
以下限制适用于 Media CDN。
配置
| 项 | 限制 | 备注 |
|---|---|---|
每个 EdgeCacheService 的 RouteRules 资源数上限 |
200 | 每个 |
每个 EdgeCacheService 的 PathMatchers 资源数上限 |
50 | 每个 |
| 每个服务的 SSL 证书数量上限 | 5 | 请参阅 SSL 证书的每个项目配额。 |
每个 EdgeCacheKeyset 的公钥数量上限 |
3 | 密钥集中的多个密钥可实现密钥轮替。随时间推移移除未使用的密钥。 |
每个 EdgeCacheKeyset 的验证共享密钥数量上限 |
3 | 密钥集中包含多个密钥,旨在实现密钥轮替:您应随着时间的推移移除旧密钥和未使用的密钥。 |
HTTP 标头、请求和状态代码
| 项 | 限制 | 备注 |
|---|---|---|
| 请求标头大小上限(包括请求路径) | 16 KiB | 此限额无法提高。
根据底层协议,请求连接要么在未写入响应代码的情况下关闭,要么被拒绝并返回 HTTP
如果已启用日志记录,系统会记录这些请求,并将 |
| 请求正文大小上限 | 16 KiB | 此限额无法提高。
如果请求的正文大小超过此限制,系统会拒绝该请求并返回 HTTP |
| 响应标头大小上限 | 约 128 KiB |
如果源站响应的标头超出此限制,则会向客户端发送 HTTP |
| 可缓存对象的大小上限 | 100 GiB |
这是媒体 CDN 可以缓存的来源对象的最大大小。较大的对象会被视为不可缓存。 此限制可提高至 1 TiB。如果您需要提高限额,请与您的 Google 支持代表联系。 |
| 不可缓存的响应大小上限 | 10239 MiB |
这是当对象不可缓存时,Media CDN 代理的响应(包括标头)中的最大字节数。不可缓存的响应在达到限制后会被截断。 |
| 标头小写转换 | 始终启用(针对媒体 CDN) | 对于请求和响应标头的字母大小写,媒体 CDN 遵循 HTTP/2 惯例。
无论使用何种协议,所有标头都会转换为小写。
例如, 标头值的大小写不会更改。 |
API 请求速率限制
如果您需要更高的 API 请求速率限制,则可以查看当前的使用情况并申请提高限制。
| 项 | 限制 |
|---|---|
每 EdgeCacheService 的失效内容数 |
每分钟 10 次 |
每个项目中不在 networkservices 命名空间中的所有调用 |
每分钟 1,200 次调用 |
只读:每个项目 GetEdgeCache*、ListEdgeCache* |
每分钟 100 次 |
读/写:networkservices 命名空间中未标记为只读的所有内容(按项目) |
每分钟 100 次 |
建议一次提交一个更新请求,例如 create、patch 和 delete。虽然该 API 会将多个并发请求排入队列,但同时提交这些请求可能会导致延迟显著增加,处理时间延长,因为系统会按顺序处理每个项目。
客户端超时
| 超时 | 时长上限 | 状态代码 | 说明 |
|---|---|---|---|
| Maximum request duration | 5 分钟 | HTTP 408 Request Timeout |
单个请求-响应的最长持续时间。 |
| Header timeout | 10 秒 | HTTP 408 Request Timeout |
客户端必须发送完整请求标头集的时间。 |
来源超时
connectTimeout和maxAttemptsTimeout限制了媒体 CDN 查找可用响应的时间。这两个超时时间都包括源返回标头以及确定是使用故障切换还是重定向所花费的时间。
connectTimeout针对每次来源尝试单独应用,而maxAttemptsTimeout包括所有来源尝试(包括故障切换和重定向)所需的连接时间。重定向后,系统会将其视为尝试连接到来源的额外尝试,并计入为配置的来源设置的maxAttempts。当 Media CDN 遇到非重定向响应(例如来自重定向源或故障切换来源)时,系统会应用
readTimeout和responseTimeout值。重定向的来源使用为遇到重定向的EdgeCacheOrigin配置的connectTimeout、readTimeout和responseTimeout值。responseTimeout和readTimeout用于控制流式响应的耗时。在 Media CDN 确定要使用上游响应后,connectTimeout和maxAttemptsTimeout都不再重要。此时,readTimeout和responseTimeout会生效。
无论每个 EdgeCacheOrigin 设置的 maxAttempts 是多少,Media CDN 最多会尝试连接所有来源四次。媒体 CDN 使用主 EdgeCacheOrigin 中的 maxAttemptsTimeout 值。每次尝试的超时值(connectTimeout、readTimeout 和 responseTimeout)是针对每次尝试的 EdgeCacheOrigin 进行配置的。
下表介绍了超时字段:
| 字段 | 默认值 | 说明 |
|---|---|---|
| connectTimeout | 5 秒 | 从开始向源服务器发送请求到媒体 CDN 确定响应是否可用,媒体 CDN 可以花费的最长时间。实际上, 超时值必须介于 1 秒和 15 秒之间。 |
| maxAttemptsTimeout | 15 秒 | 尝试连接到来源(包括故障切换来源)的最大总次数,达到此上限后,系统会向客户端返回错误。
如果达到超时限制,系统会先返回 HTTP 超时值必须介于 1 秒到 30 秒之间。 此设置用于定义所有来源连接尝试(包括故障切换来源)的总时长,以便限制客户端必须等待内容开始在线播放的总时长。系统只会使用第一个 |
| readTimeout | 15 秒 | 单个 HTTP 响应的读取之间等待的最大时长。
|
| responseTimeout | 30 秒 | 允许完成响应的最长时长。 超时值必须介于 1 秒到 120 秒之间。 时长从收到第一个正文字节时开始计算。如果在响应完成之前达到此超时时间,系统会截断响应并记录日志。 |
Manage quotas
Media CDN 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:
|
Check your quota
Console
- In the Google Cloud console, go to the Quotas page.
- 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_IDTo 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.