Controlling costs using billing alerts (beta)
You can set project-wide billing alerts to help you keep track of your costs and avoid surprises on your bills. Once you’ve set an alert on your account, the Billing Alerts feature will send email notifications to billing administrators when the charges for the current month exceed the threshold you’ve set. For more details, see Google Cloud Platform Billing Alerts.
Controlling query costs using BigQuery custom quotas
For some customers, especially those in large organizations with multiple projects and users, the BigQuery custom quotas feature provides a more granular query cost control mechanism.
BigQuery custom quotas enable you to specify a limit on the number of bytes processed per day, in 10 TB increments. You can set limits at the project level or across all users.
-
The project-level limit applies to the aggregate usage in that project.
-
The project's user-level limit is separately applied to each user or service account within a project individually.
For current query pricing per TB processed, see the pricing page.
To enable custom quotas, see How to set or modify custom quotas.
How custom quotas are enforced
After you enable the custom quotas feature, BigQuery enforces your quotas by returning an error when you exceed a quota that you have set.
If you exceed a project-level custom quota, BigQuery returns the following quotaExceeded error:
Custom quota exceeded: Your project exceeded the custom quota for query bytes scanned, which is set by your administrator. For more information, see https://cloud.google.com/bigquery/cost-controls
If a user exceeds a user-level custom quota, BigQuery returns a quotaExceeded error with a different error message:
Custom quota exceeded: Your project_user exceeded the custom quota for query bytes scanned per user, which is set by your administrator. For more information, see https://cloud.google.com/bigquery/cost-controls
Example
Suppose you set the following custom quotas for a project with 10 users, one of which is a service account:
- Project-level: 50TB per day
- User-level: 10TB per day
The following table describes the remaining quota as the 10 users run queries thoughout the day.
| Usage | Remaining Quota |
|---|---|
| Project-level: 10 TBs remain. User-level: 6 TBs per user remain, but only up to 10 TBs total. |
|
| The service account queries another 6 TBs | Project-level: 4 TBs remain. User-level: The service account can no longer use BigQuery. 6 TBs per user remain for the other users, but only up to 4 TBs total. |
| One user queries another 4 TBs | Project-level: 0 TBs remain. User-level: Various TBs remain, but no one can use BigQuery because the project-level quota has been exceeded. |
With no remaining quota, BigQuery stops working for everyone in that project.
How to set or modify custom quotas
To enable the custom quotas feature or modify an existing custom quota, complete the BigQuery Custom Quota Request form and click Submit. You will usually receive a response within 2 to 3 business days.
FAQs
Can customers self-provision custom quotas?
No, you must use the BigQuery Custom Quota Request form.
How will I know what my custom quota levels are?
After you submit the form, you will receive an email confirmation that verifies your custom quota preferences.
When is my custom quota refilled?
Your quota is refilled at regular intervals throughout the day—currently one percent (1%) of your daily quota in intervals of approximately 15 minutes.
For example, if you have a custom quota of 50 TBs and you exhaust the quota, you only have to wait about 15 minutes for 500 GBs to become available. If you wait about 30 minutes, you'll have 1 TB available.
What if I exceeded my custom quota, but I want to reset it?
You can run your query from another project that has access to your datasets and that doesn't have a custom quota or hasn't yet exceeded it. Alternatively, you can wait approximately 15 minutes when your quota is partially refilled.
Is custom quota proactive or reactive, or in other words, can I run an 11TB query if I have a 10TB quota?
Custom quota is proactive, so you won't be able to run an 11TB query if you have a 10TB quota.