问题
I sometimes get the following error when creating a subscription:
Insufficient tokens for quota 'administrator' and limit 'CLIENT_PROJECT-100s' of service 'pubsub.googleapis.com' for consumer 'project_number:'
Waiting it out does the trick, but I'd like to increase the quota. In the IAM & Admin section of the Google Cloud Console, I can filter on the Pub/Sub API, but can't find the limit...
回答1:
You are running up against the quota for administrative operations. In the Quotas page, under "Quota type," select "All quotas," then under "Service" select "Google Cloud Pub/Sub API." The quota you want to increase is "Administrator operations per 100 seconds," which you can update up to the maximum allowed limit of 10,000 per 100 seconds, as detailed on the Pub/Sub quota page. Here is a screenshot of the entity you need to update:
回答2:
I was hitting a similar error.
I checked the quota section — as per Kamal Aboul-Hosn's suggestion — however it was already maxed out.
A work around was to put a sleep function in the code so the API wouldn't get hammered over a hundred second period. I hope that helps.
回答3:
According to AboulHosen on the GCP Slack:
"It does look like quota is pooled across users of the default application credentials and that the quota is significantly lower for users authenticated in this way. I believe when going to app engine, a service account is created (https://cloud.google.com/appengine/docs/flexible/python/access-control#using_service_accounts), so I would not anticipate this error happening when running on app engine."
So the reason this is happening is because the quota for your admin credentials is being consumed elsewhere, and as far as I know, there is no way to increase this!
来源:https://stackoverflow.com/questions/44414185/insufficient-tokens-for-quota-administrator-and-limit-client-project-100s-of