[英]Google Cloud Vision API returning “429 - Quota Exceeded”
I've had a Cloud Function that makes Vision API requests, specifically Document Text Detection requests. 我有一个云功能,可以提出Vision API请求,特别是文档文本检测请求。 My peak requests rate is usually around ~120-150 requests per minute on an average day. 我的峰值请求率通常在平均每天约120-150次请求。
I've suddenly been getting resource quota exceeded errors for Vision API requests with a request rate at 2500 requests per minute. 我突然遇到Vision API请求的资源配额超出错误,请求率为每分钟2500个请求。 Some things to note: 有些事情需要注意:
I've had no code changes in 3 months 我在3个月内没有更改代码
I deleted and redeployed the Cloud Function making these requests to stop any problematic image that was causing a runaway loop 我删除并重新部署了Cloud Function,使这些请求能够阻止导致失控循环的任何有问题的图像
My code calling the API nor the cloud functions themselves were getting retried so there really wasn't a way that I could exponentially increase my request rate overnight with no changes introduced. 调用API的代码和云函数本身都在重试,所以我没有办法在没有引入任何更改的情况下在一夜之间以指数方式提高请求率。
The service account making the Vision calls is making the normal amount of requests and is only in use by the cloud function ie not being used by someone's local script 进行Vision调用的服务帐户正在进行正常数量的请求,并且仅由云功能使用,即不被某人的本地脚本使用
I've since turned on retries to mitigate this issue since it'll "work" with exponential back off but this is expensive to do, especially with the vision API. 我已经开启重试以缓解这个问题,因为它会以指数退避的方式“工作”,但这样做很昂贵,特别是使用视觉API。 Is there anything I can do to find out the root cause of this issue? 我能做些什么来找出这个问题的根本原因吗?
To identify the specific quota being exceeded, Stackdriver API helps by using Monitoring quota metrics as explained here . 要确定具体配额被超过,为Stackdriver API有助于通过监控限额指标作为解释在这里 。
GCP lets you specify quota being exceeded in greater depth using the Stackdriver API and UI, with quota metrics appearing in the Metrics Explorer. GCP允许您使用Stackdriver API和UI更深入地指定超出配额,并在Metrics Explorer中显示配额指标。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.