简体   繁体   English

如何查看 gmail api 的每个用户配额限制?

[英]How to see per user quota limit for gmail api?

We are using gmail api to parse latest mails for a few email ids.我们正在使用 gmail api 解析一些电子邮件 ID 的最新邮件。 After few hours of running, we always encounter:经过几个小时的运行,我们总会遇到:

{
 "code" : 429,
 "errors" : [ {
   "domain" : "global",
   "message" : "User-rate limit exceeded.  Retry after 2020-08-25T05:11:14.899Z",
   "reason" : "rateLimitExceeded"
 } ],
 "message" : "User-rate limit exceeded.  Retry after 2020-08-25T05:11:14.899Z",
 "status" : "RESOURCE_EXHAUSTED"
}

I want to see user rate limit data but the gmail api metrics only show us our app metrics.我想查看用户速率限制数据,但 gmail api 指标仅向我们显示我们的应用指标。
I have the email id credentials also with me.我也有电子邮件 ID 凭据。 Is there any place we can check to exactly pinpoint how much of a surge is causing 429 error?有什么地方我们可以检查以准确查明导致 429 错误的浪涌程度吗? From our app, we are sending about 3 requests/second (message.get, message.list, message.attachment.get, message.modify) as seen from the api metrics we have with us.从我们的 api 指标中可以看出,从我们的应用程序中,我们每秒发送大约 3 个请求(message.get、message.list、message.attachment.get、message.modify)。 The per user quota limit is 15000/minute or 250/second and we don't seem to be hitting no where near the limit.每个用户的配额限制是 15000/分钟或 250/秒,我们似乎并没有达到极限。 Based on this, we can only conclude that the email id has given oauth tokens to multiple apps who are hitting it relentlessly to cross the limit.基于此,我们只能得出结论,电子邮件 id 已将 oauth 令牌提供给多个应用程序,这些应用程序无情地突破限制。 Now only if we could see why it is happening and adjust our hit rate accordingly to minimize any chance of 429.现在只有当我们能看到它发生的原因并相应地调整我们的命中率以最大限度地减少 429 的可能性。
Also, if this is not possible then please suggest us a good hit rate/second so that 429 never happens.另外,如果这是不可能的,那么请建议我们一个好的命中率/秒,这样 429 就不会发生。

429 error User-rate limit exceeded with returned with a time to retry mostly means you are hitting the Mail sending limits 429 错误User-rate limit exceededreturned with a time to retry主要意味着您达到了邮件发送限制

Those limits are featured here :这些限制在这里有特色:

Messages per day: 2,000 (500 for trial accounts)每天消息:2,000(试用帐户为 500)

Messages auto-forwarded: 10,000自动转发的消息:10,000

Auto-forward mail filters: 20自动转发邮件过滤器:20

Recipients per message: 2,000 total per message (maximum of 500 external recipients)每条消息的收件人:每条消息总共 2,000 个(最多 500 个外部收件人)

Recipients per message sent via SMTP (by POP or IMAP users) or the Gmail API: 100通过 SMTP(由 POP 或 IMAP 用户)或 Gmail API 发送的每封邮件的收件人:100

Total recipients per day: 3,000 (2,000 external, 500 external for trial accounts) 5 emails sent to 10 different addresses count as 10 unique recipients* 5 emails sent to a single address count as 1 unique recipient*每天的收件人总数:3,000(2,000 个外部,500 个外部试用帐户) 发送到 10 个不同地址的 5 封电子邮件计为 10 个唯一收件人* 发送到单个地址的 5 封电子邮件计为 1 个唯一收件人*

Those limits are not related to the request rate per minute / second, but to the daily sending limits.这些限制与每分钟/秒的请求速率无关,而是与每日发送限制有关。 Mind that if you have a trial user, your limits might be well below the ones for paying users.请注意,如果您有试用用户,您的限制可能远低于付费用户的限制。

Both your daily and minute based queries can be verified when you go in your GCP console on Gmail API -> Quotas - and select the relevant type from the dropdown.当您通过Gmail API -> Quotas进入 GCP 控制台并从下拉列表中选择相关类型时,您可以验证基于每日和分钟的查询。

If it shows that you are below the limit or you are not sure which limits you are hitting, you have the option to contact GSuite support for assistance.如果它显示您低于限制或您不确定自己达到了哪些限制,您可以选择联系GSuite 支持寻求帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM