Current Query Usage Exceeds Quota Limit in Big Query.

I’ve encountered an issue where the quota usage exceeds the quota limit.
From Big Query APIFrom Big Query API
I’ve already reviewed all configurations, and everything seems to be in order according to standard settings.
After exceeds I cannot do query again (as expected).
Query exceed the limit after exceeds 2 MB.Query exceed the limit after exceeds 2 MB.
I suspect that this might be due to a lag in updating the quota limit, a system error, or potentially there is a tolerance for queries under 10MB.

Please help if you have any idea what caused this issue. 

Solved Solved
0 4 1,052
1 ACCEPTED SOLUTION

The situation you're describing, where the current usage exceeds the set quota limit, could be due to a few factors:

  1. Query Completion Time: If you ran a query that started before the quota was reached and it completed after the quota was exceeded, the total bytes processed by that query might push the usage over the limit. BigQuery processes queries atomically, meaning that if a query starts, it will complete even if it pushes you over your quota.

  2. Delayed Reporting: There could be a delay in the reporting of the quota usage. This means that some queries that were executed just before the limit was reached might only be reported after the limit has been exceeded.

  3. Quota Calculation Method: The way BigQuery calculates quota usage might not be straightforward. It could include additional factors like the data processed by query execution plans or other internal metrics.

  4. Caching: BigQuery does not charge for queries that return cached results, but it's possible that if the cache expires and the query re-runs, it could contribute to the quota unexpectedly.

  5. Background Processes: There might be background processes or automated scripts that are running queries on your behalf which you might not have accounted for.

  6. Billing Cycle Alignment: The quota usage might not align perfectly with the billing cycle, especially if changes to quotas are made mid-cycle.

If you consistently see that the usage exceeds the quota by a small margin and it's causing issues, you might want to set a slightly lower quota to create a buffer or reach out to Google Cloud Support for a more detailed explanation of how the quota usage is calculated and reported.

View solution in original post

4 REPLIES 4

There are a few possible causes for why you might be encountering a "Custom quota exceeded" error even though you have already reviewed all configurations and everything seems to be in order according to standard settings.

Quota Lag: While it's possible there could be a lag in the quota system, it's generally not more than a few minutes. Google's quota system is near real-time, and any delays are typically resolved within a short period. If the issue persists for an extended time, it's less likely to be a simple lag.

System Error: Before contacting Google Cloud support, users should ensure they have thoroughly investigated all possible causes on their end. This includes reviewing the query history for unexpected queries, checking for automated scripts or scheduled queries, and confirming that no other users are contributing to the quota usage. Additionally, users should check the error logs and system health reports for any indications of underlying issues.

Tolerance for Queries Under 10MB: The tolerance for queries under a certain size is not a standard feature of Google Cloud's quota system. Instead, the quota typically counts all queries regardless of size. If there is a tolerance, it would be a custom setting implemented by an administrator. Users should check with their administrator to determine if such a setting is in place.

Optimize Queries: This is a crucial step in reducing quota usage. Users should ensure their queries are efficient, using proper filters, selecting only the necessary columns, and avoiding unnecessary data processing. Additionally, they should consider using materialized views or caching results to minimize repetitive queries.

Request a Quota Increase: This is an option when a user's legitimate needs consistently exceed the quota limit. The process typically involves submitting a formal request to Google Cloud, providing justification for the increase, and possibly discussing cost implications.

Check Billing Account: Ensure that the billing account linked to the project is in good standing and has sufficient funds to cover the project's resource usage. Sometimes quota issues can be related to billing problems or payment holds.

Review Documentation: The link provided in the error message (https://cloud.google.com/bigquery/cost-controls) should be thoroughly reviewed for detailed information on BigQuery's cost controls and how quotas work. This can help users understand the quota system's nuances and avoid exceeding limits unintentionally.

Monitor Quota in Real-Time: Google Cloud Platform provides tools like the Cloud Monitoring service to monitor quota usage in real-time. It's a good practice to set up alerts for when you're approaching your quota limit, allowing you to take proactive measures to prevent exceeding the quota.

Summary:

  • Investigate all potential internal causes before contacting Google Cloud support.
  • Optimize queries to reduce data processing and unnecessary usage.
  • Consider requesting a quota increase if legitimate needs consistently exceed the limit.
  • Check billing account status and ensure sufficient funds are available.
  • Review documentation and utilize monitoring tools to proactively manage quota usage.

Thank you for your explanation.

 As I understand from the documentation, the quota limit for QueryUsagePerDay is the number of bytes that can be processed by queries, so the current usage should be equal to or lower than the quota limit. However, in my case, the current usage is 102MB while the quota limit is 100MB, so it is exceeding 2MB.

To reproduce the issue, I followed these steps:
  1. I changed the quota usage per day from unlimited to 100MB.
  2. I ran some queries until I could no longer run anymore because I had exceeded the custom quota for QueryUsagePerDay. [1]
  3. I checked the current usage for QueryUsagePerDay in the BigQuery API, and it showed 102MB when my custom quota is 100MB. [2]
So, I am not saying that I don’t believe that the quota should not have been exceeded, but I am curious to know why the current usage can exceed 2MB over the quota limit. 

As it is shown in Big Query API that current usage > 2MB than QuotaUsagePerDay Limit
[1] [1] Cutom Quota Exceeded.png
[2][2] Current Usage_Quota Limit.png

The situation you're describing, where the current usage exceeds the set quota limit, could be due to a few factors:

  1. Query Completion Time: If you ran a query that started before the quota was reached and it completed after the quota was exceeded, the total bytes processed by that query might push the usage over the limit. BigQuery processes queries atomically, meaning that if a query starts, it will complete even if it pushes you over your quota.

  2. Delayed Reporting: There could be a delay in the reporting of the quota usage. This means that some queries that were executed just before the limit was reached might only be reported after the limit has been exceeded.

  3. Quota Calculation Method: The way BigQuery calculates quota usage might not be straightforward. It could include additional factors like the data processed by query execution plans or other internal metrics.

  4. Caching: BigQuery does not charge for queries that return cached results, but it's possible that if the cache expires and the query re-runs, it could contribute to the quota unexpectedly.

  5. Background Processes: There might be background processes or automated scripts that are running queries on your behalf which you might not have accounted for.

  6. Billing Cycle Alignment: The quota usage might not align perfectly with the billing cycle, especially if changes to quotas are made mid-cycle.

If you consistently see that the usage exceeds the quota by a small margin and it's causing issues, you might want to set a slightly lower quota to create a buffer or reach out to Google Cloud Support for a more detailed explanation of how the quota usage is calculated and reported.

Thank you so much, now I understand why it could happened.