I am running a single-threaded script which consumes data from the G Suite Sheets API.
After some time, the following 429 HTTP error pops up in the logs:
"Quota exceeded for quota group 'ReadGroup' and limit 'Read requests per user per 100 seconds' of service 'sheets.googleapis.com' for consumer...
And my quota limits have been set by default as follows (Ilimitado means unlimited):
My client last log lines before the error:
[2020-05-14 02:21:37,114: INFO/ForkPoolWorker-1] URL being requested: GET https://sheets.googleapis.com/v4/spreadsheets/<SHEET_ID>?alt=json
[2020-05-14 02:21:37,517: WARNING/ForkPoolWorker-1] Sleeping 1.19 seconds before retry 1 of 5 for request: GET https://sheets.googleapis.com/v4/spreadsheets/<SHEET_ID>?alt=json, after 429
[2020-05-14 02:21:39,057: WARNING/ForkPoolWorker-1] Sleeping 2.68 seconds before retry 2 of 5 for request: GET https://sheets.googleapis.com/v4/spreadsheets/<SHEET_ID>?alt=json, after 429
[2020-05-14 02:21:42,089: WARNING/ForkPoolWorker-1] Sleeping 3.16 seconds before retry 3 of 5 for request: GET https://sheets.googleapis.com/v4/spreadsheets/<SHEET_ID>?alt=json, after 429
[2020-05-14 02:21:45,606: WARNING/ForkPoolWorker-1] Sleeping 0.77 seconds before retry 4 of 5 for request: GET https://sheets.googleapis.com/v4/spreadsheets/<SHEET_ID>?alt=json, after 429
[2020-05-14 02:21:46,722: WARNING/ForkPoolWorker-1] Sleeping 20.65 seconds before retry 5 of 5 for request: GET https://sheets.googleapis.com/v4/spreadsheets/<SHEET_ID>?alt=json, after 429
[2020-05-14 02:22:07,735: WARNING/ForkPoolWorker-1] sheets#sheet: HTTP error (code 429): Quota exceeded for quota group...
I can identify here some kind of exponential backoff retry algorithm in the googleapiclient
library, but what I would like know is (specially after the 20.65 seconds pause) why the server is still unable to respond with a 2XX HTTP response.
- Does it require to wait for the 100 seconds interval to end, once the first 100 requests have been received before consuming the next 100?
- If so, how could I circumvect this without modifying the quota?
Thank you for your time.