如何查看Gmail API每个用户的配额限制?

huangapple go评论65阅读模式
英文:

How to see per user quota limit for gmail api?

问题

我们正在使用Gmail API来解析几个电子邮件ID的最新邮件。在运行几个小时后,我们总是遇到:

{
   "code" : 429,
   "errors" : [ {
     "domain" : "global",
     "message" : "用户速率限制超过。请在2020-08-25T05:11:14.899Z之后重试",
     "reason" : "rateLimitExceeded"
   } ],
   "message" : "用户速率限制超过。请在2020-08-25T05:11:14.899Z之后重试",
   "status" : "RESOURCE_EXHAUSTED"
}

我想查看用户速率限制数据,但Gmail API指标只显示我们的应用程序指标。
我也有电子邮件ID凭据。是否有任何地方可以检查确切地指出是什么原因导致了429错误?从我们的应用程序,我们每秒发送约3个请求(message.get,message.list,message.attachment.get,message.modify),正如我们在API指标中所看到的那样。每个用户的配额限制为每分钟15000次或每秒250次,我们似乎远未达到限制。基于此,我们只能得出结论,该电子邮件ID已向多个应用程序提供了OAuth令牌,这些应用程序正在不断地击中它以突破限制。现在,只有我们能够看到为什么会发生这种情况,并相应地调整我们的命中率,以最小化发生429错误的可能性。
另外,如果这不可能,请建议我们一个适当的命中率/秒,以便永远不会出现429错误。

英文:

We are using gmail api to parse latest mails for a few email ids. 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.<br>
I have the email id credentials also with me. Is there any place we can check to exactly pinpoint how much of a surge is causing 429 error? 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. The per user quota limit is 15000/minute or 250/second and we don't seem to be hitting no where near the limit. 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. Now only if we could see why it is happening and adjust our hit rate accordingly to minimize any chance of 429.<br>
Also, if this is not possible then please suggest us a good hit rate/second so that 429 never happens.

答案1

得分: 1

429错误 User-rate limit exceeded,并附带 returned with a time to retry,通常意味着您已达到邮件发送限制

这些限制在此处有详细说明:

> 每天的邮件数量:2,000封(试用账户为500封)
> 自动转发的邮件数量:10,000封
> 自动转发邮件筛选器:20个
> 每封邮件的收件人数量:2,000个(每封邮件最多500个外部收件人)
> 通过SMTP(由POP或IMAP用户)或Gmail API发送的每封邮件的收件人数量:100个
> 每天的总收件人数量:3,000个(其中外部收件人为2,000个,试用账户为500个)
发送给10个不同地址的5封邮件计为10个唯一收件人*
发送到单个地址的5封邮件计为1个唯一收件人*

这些限制与每分钟/每秒的请求速率无关,而是与每日发送限制有关。 请注意,如果您是试用用户,您的限制可能远低于付费用户的限制。

您每天和每分钟的查询次数可以在您的GCP控制台中的Gmail API -&gt; 配额中验证,然后从下拉菜单中选择相关类型。

如果显示您未达到限制,或者您不确定自己达到了哪些限制,您可以选择联系GSuite支持团队寻求帮助。

英文:

429 error User-rate limit exceeded with returned with a time to retry mostly means you are hitting the Mail sending limits

Those limits are featured here:

> Messages per day: 2,000 (500 for trial accounts)

> Messages auto-forwarded: 10,000

> Auto-forward mail filters: 20

> Recipients per message: 2,000 total per message
(maximum of 500 external recipients)

>Recipients per message sent via SMTP (by POP or IMAP users) or the 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*

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 -&gt; Quotas - and select the relevant type from the dropdown.

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.

huangapple
  • 本文由 发表于 2020年8月27日 03:59:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/63604944.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定