AbdFatah / analytics-issues

Automatically exported from code.google.com/p/analytics-issues
0 stars 0 forks source link

Quota Error (rateLimitExceeded) being returned #286

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
---------------------------------------------------------------------------
NOTE: This issue tracking system is for Google Analytics developer products
only.
If you are not a developer/programmer visit:
http://www.google.com/analytics/support.html
---------------------------------------------------------------------------
Name of affected component: Core Reporting API

Name of related library and version, if applicable (e.g. Java, Python,
HTTP, Objective-C, etc.): Java

Issue summary:

I've noticed that the reporting API will return "rateLimitExceeded" (403 error 
code) throughout the day even though my application is nowhere near the quota 
limits.  

Here's the error:
[{"domain":"global","message":"Quota Error: Rate Limit 
Exceeded","reason":"rateLimitExceeded"}]

We are well below our overall rate limit.  We suspect that this might be due to 
QPS limits but according to the documentation, if our application uses the 
"userIp" or "quotaUser" parameter, then the 10 QPS is effectively applied PER 
USER.  If this is the case, there's no way we are sending even close to 10 
queries per second PER USER.  Our application is designed to fetch data per 
profile at regularly spaced intervals.  Upon each successful report query, we 
process the data on our side before making another query so there's no way we 
can do 10 queries in a second (per user, that is).  

Here's the documentation I'm referring to:

- 10 queries per second (QPS) per IP.
- In the APIs Console this quota is referred to as the per-user limit. By 
default, it is set to 1 query per second (QPS) and can be adjusted in the 
Quotas pane to a maximum value of 10. If the per-user limit is set to a value 
larger than 10 QPS, the Google Analytics quota policy will still take effect 
and limit per-user requests to 10 QPS.
- If your application makes all API requests from a single IP address (i.e. on 
behalf of your users) you should consider using the userIP or 
quotaUserparameters with each request to get full QPS quota for each user. See 
the query parameters summary for details.

In addition, we have a backoff strategy anytime we encounter a 403 quota error. 
 We've seen incidences where a particular GA user/profile will get this 403 
quota error 5 straight times, with each call being spaced out by more than 1 
hour (incrementally more spaced based on backoff strategy).

Steps to reproduce issue:
1. Perform regular Core Reporting API call
2. Our application performs this call many times a day for our customers but 
well below our rate limit
3.

Expected output:

No error since we are below our overall rate limit and also QPS setting 
(assuming "quotaUser" works)

Actual results:

Error as indicated above

Notes:
Provide any additional information which might be useful here. Feel free to
attach screenshots or sample code which demonstrates the issue being
described.

Original issue reported on code.google.com by ja...@sumall.com on 17 Apr 2013 at 4:30

GoogleCodeExporter commented 9 years ago
There are other higher level rate limiting quotas to protect systems that you 
are likely hitting. Regardless, if you encounter 403 rate limits errors 
(actually any error) you should back off requests as per 
https://developers.google.com/analytics/devguides/reporting/core/v3/coreErrors

Original comment by pfrise...@google.com on 10 Oct 2014 at 6:03