Skip to content
This repository has been archived by the owner on Jun 27, 2021. It is now read-only.

Set custom quota user to avoid throttling #34

Open
morgante opened this issue Dec 4, 2018 · 8 comments
Open

Set custom quota user to avoid throttling #34

morgante opened this issue Dec 4, 2018 · 8 comments
Labels
enhancement New feature or request

Comments

@morgante
Copy link

morgante commented Dec 4, 2018

The admin SDK supports setting arbitrary quotaUser values: https://developers.google.com/admin-sdk/directory/v1/parameters

If this isn't set, the consumer IP will be used which can lead to throttling.

Updating the provider to use a custom/random quota user on each request would reduce throttling.

@DeviaVir DeviaVir added the enhancement New feature or request label Dec 5, 2018
@DeviaVir
Copy link
Owner

Hey @morgante, it's unfortunately not really clear to me how to use this with the oauth clients in golang used in this provider. Any suggestions or links? I tried searching the web but only found Java results.

@morgante
Copy link
Author

Unfortunately I'm not familiar with the Go SDK but I'm guessing it might be a flag where you set the access token?

@DeviaVir
Copy link
Owner

I believe that would have to happen somewhere here:
https://github.com/DeviaVir/terraform-provider-gsuite/blob/master/gsuite/config.go#L49-L100
but at this time I'm unsure of the change that is required to make that work, it'd seem like oauth would need to accept another query parameter?

@psalaberria002

This comment has been minimized.

@DeviaVir

This comment has been minimized.

@TheWolfNL
Copy link
Contributor

The quotauser can be used if you decide to apply a cap, this is an Opt in (from what i understand from the docs).
The page OP mentions also links to the capping instructions which explain how to enable this.

Other than that the usage limits are per API (also mentioned on the capping page) so unless you have a script spamming the Directory API I don't expect anyone to hit this limit / needing this feature.

So.. time to close this issue?

@morgante
Copy link
Author

@TheWolfNL It is possible to set caps yourself, but Google also enforces certain caps out of the box (per IP) to prevent abuse.

This provider can end up making a lot of requests to the Directory API if you're creating multiple groups and managing their membership.

@DeviaVir
Copy link
Owner

I can attest to the fact this provider can easily hit quota limits on the Directory API if you control a lot of groups. Wondering if quotauser needs to be set on every request, and if we can set it to the group email while refreshing...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants