userRateLimitExceeded is flood protection basically. Its used to prevent people from sending to many requests to fast.
Indicates that the user rate limit has been exceeded. The maximum rate
limit is 10 qps per IP address. The default value set in Google
Developers Console is 1 qps per IP address. You can increase this
limit in the Google Developers Console to a maximum of 10 qps.
You need to slow your code down, by implementing Exponential Backoff.
- Make a request to the API
- Receive an error response that has a retry-able error code
- Wait 1s + random_number_milliseconds seconds
- Retry request
- Receive an error response that has a retry-able error code
- Wait 2s + random_number_milliseconds seconds
- Retry request
- Receive an error response that has a retry-able error code
- Wait 4s + random_number_milliseconds seconds
- Retry request
- Receive an error response that has a retry-able error code
- Wait 8s + random_number_milliseconds seconds
- Retry request
- Receive an error response that has a retry-able error code
- Wait 16s + random_number_milliseconds seconds
- Retry request
- If you still get an error, stop and log the error.
The idea is that every time you see that error you wait a few seconds then try and send it again. If you get the error again you wait a little longer.
Quota user:
Now I am not sure how your application works but, If all the quests are coming from the same IP this could cause your issue. As you can see by the Quota you get 10 requests per second / per user. How does Google know its a user? They look at the IP address. If all your reuqests are coming from the same IP then its one user and you are locked to 10 requests per second.
You can get around this by adding QuotaUser to your request.
quotaUser - Alternative to userIp. Link
- Lets you enforce per-user quotas from a server-side application even in cases when the user's IP address is unknown. This can occur,
for example, with applications that run cron jobs on App Engine on a
user's behalf.
- You can choose any arbitrary string that uniquely identifies a user, but it is limited to 40 characters.
- Overrides userIp if both are provided.
- Learn more about capping usage.
If you send a different quotauser on every reqest, say a random number, then Google thinks its a different user and will assume that its only one request in the 10 seconds. Its a little trick to get around the ip limitation when running server applications that request everything from the same IP.