Spanner Data Boost is subject to quotas that limit the number of concurrent
ExecuteStreamingSQL
and StreamingRead
calls executing per project and per
region. When the number of concurrent requests exceeds the quota, requests fail
with RESOURCE EXHAUSTED
errors.
Check your quota
To check the concurrency quota in your project, follow these steps:
Go to the Quotas page in the Google Cloud console.
In the Filter field, enter
databoost
. Then, in the list, select DataBoostQuotaPerProjectPerRegion.In the resulting table, locate your region and view the limit for that region.
Monitor quota usage
To monitor your quota usage, follow these steps:
- In the Google Cloud console, go to Monitoring.
Go to Monitoring - If Metrics Explorer is shown in the navigation menu, select it. Otherwise, click Resources, and then select Metrics Explorer.
- At the top of the page, select a time interval.
- In the Metric dropdown list, in the Filter by resource or metric
name field, enter
consumer
and pressEnter
to narrow the search. - In the list, select Consumer Quota > Quota > Concurrent Quota usage, and then click Apply.
- Click + ADD FILTER to create a filter.
- In the Label 1 dropdown list, select quota_metric.
In the Value 1 text field, enter or select spanner.googleapis.com/data_boost_quota.
Metrics explorer shows a line chart of quota usage by region.
Optional: Under Display, for Widget type, select Stacked bar chart.
Monitor quota errors
To monitor quota errors, follow these steps:
In Metrics explorer, select the metric Consumer Quota > Quota > Quota exceeded error.
Add a filter for quota_metric equals spanner.googleapis.com/data_boost_quota.
Set an alert for Data Boost usage
You can create an alert policy that notifies you when the number of concurrent
partitioned queries that request
Data Boost (concurrent ExecuteStreamingSQL
and StreamingRead
calls) per project and per region exceeds a particular threshold. To do so,
follow these steps:
- Follow the instructions in Create metric-threshold alerting policies.
- In the Select a metric dropdown list, in the Filter by resource or
metric name field, enter
data_boost
and pressEnter
to narrow the search. - In the Select a metric list, select Cloud Spanner Instance > Instance > Processing Unit Second, and then click Apply.
Continue with creating an alert policy and set the threshold to some percentage of the quota.
For example if the default quota is 200 and you want to be notified when the number of concurrent requests reaches 80% of maximum, enter 160 in the Threshold value field.
Handle quota errors
If the rate of quota-exceeded errors is high, when using Dataflow with Data Boost, we recommend that you adjust the maximum number of workers in your Dataflow job to avoid exceeding the Data Boost quota. You can also apply for a higher quota.
Block a principal from consuming Data Boost resources
If one principal is consistently exceeding the amount of
Data Boost resources that they can be reasonably expected to
consume, you can block the principal from using Data Boost
resources by revoking the spanner.databases.useDataBoost
Identity and Access Management
(IAM) permission from the principal. You can automate revoking
the permission by configuring an alert's notification channel as a webhook that
invokes a Cloud Function. For more information, see the following topics:
- Create a notification channel
- Cloud Functions
- Remove database-level permissions
Modify the allow policy for sample code that revokes a role.
What's next
- Learn about Data Boost in Data Boost overview.