Use the Knowledge Base AI to help improve your Cloud Posture

Configure Rate Limits for Task Dispatches

Trend Vision One™ provides continuous assurance that gives peace of mind for your cloud infrastructure, delivering over 1100 automated best practice checks.

Risk Level: Medium (should be achieved)

Ensure optimal rate limits are configured for task dispatches in your Cloud Tasks queue settings in order to prevent unexpected spikes in task execution that could exhaust downstream services or exceed quotas. Before running this conformity rule, ensure the rate limits (i.e., "maxDispatchesPerSecond" and "maxConcurrentDispatches") are set in the Trend Cloud One™ – Conformity account settings.

Reliability
Performance
efficiency

Rate limiting determines the maximum rate at which a Cloud Tasks queue dispatches tasks. By configuring optimal rate limits for your Cloud Tasks queues, you can ensure controlled, efficient, and predictable task processing, avoiding disruptions to your application and downstream systems.


Audit

To determine if optimal rate limits are configured for your Google Cloud Tasks queues, perform the following operations:

Using GCP Console

01 Sign in to your Trend Cloud One™ – Conformity account, access the Configure Rate Limits for Task Dispatches conformity rule settings and identify the rate limits (i.e., maxDispatchesPerSecond and maxConcurrentDispatches values) defined for the rule.

02 Sign in to the Google Cloud Management Console.

03 Select the Google Cloud Platform (GCP) project that you want to examine from the console top navigation bar.

04 Navigate to Cloud Tasks Queues console available at https://console.cloud.google.com/cloudtasks to access the list of Cloud Tasks queues available for the selected GCP project.

05 Click on the name (link) of the queue that you want to examine and select the CONFIGURATION tab to view the configuration settings available for the selected resource.

06 In the Rate limits section, check the values of the Max rate and Max concurrent attributes to determine the rate limits (i.e., maxDispatchesPerSecond and maxConcurrentDispatches) configured for your queue. If the rate limits configured for your queue exceed those defined in the conformity rule settings identified in step 1, the rate limiting configuration for the selected Cloud Tasks queue is not compliant.

07 Repeat steps no. 5 and 6 for each Cloud Tasks queue available within the selected GCP project.

08 Repeat steps no. 3 - 7 for each project deployed within your Google Cloud account.

Using GCP CLI

01 Sign in to your Trend Cloud One™ – Conformity account, access the Configure Rate Limits for Task Dispatches conformity rule settings and identify the rate limits (i.e., maxDispatchesPerSecond and maxConcurrentDispatches values) defined for the rule.

02 Run projects list command (Windows/macOS/Linux) with custom output filters to list the ID of each project available in your Google Cloud Platform (GCP) account:

gcloud projects list
	--format="table(projectId)"

03 The command output should return the requested GCP project IDs:

PROJECT_ID
cc-web-project-123123
cc-iot-project-112233

04 Run tasks queues list command (Windows/macOS/Linux) with the ID of the GCP project that you want to examine as the identifier parameter and custom output filters to describe the ID (i.e., fully qualified identifier) of each Cloud Tasks queue created for the selected project, in the specified region:

gcloud tasks queues list
	--project="cc-web-project-123123"
	--location="us-central1"
	--format="default(name)"

05 The command output should return the requested queue IDs:

---
name: projects/cc-web-project-123123/locations/us-central1/queues/cc-app-notification-queue
---
name: projects/cc-web-project-123123/locations/us-central1/queues/cc-invoice-release-queue

06 Run tasks queues describe command (Windows/macOS/Linux) with the ID of the Cloud Tasks queue that you want to examine as the identifier parameter, to describe the rate limits (i.e., maxDispatchesPerSecond and maxConcurrentDispatches) configured for the selected queue:

gcloud tasks queues describe projects/cc-web-project-123123/locations/us-central1/queues/cc-app-notification-queue
	--format="default(rateLimits.maxDispatchesPerSecond,rateLimits.maxConcurrentDispatches)"

07 The command output should return the requested configuration values:

rateLimits:
maxDispatchesPerSecond: 500.0
maxConcurrentDispatches: 3000

If the rate limits configured for your queue, returned by the tasks queues describe command output, exceed those defined in the conformity rule settings identified in step 1, the rate limiting configuration for the selected Cloud Tasks queue is not compliant.

08 Repeat steps no. 6 and 7 for each Cloud Tasks queue available in the selected GCP project.

09 Repeat steps no. 4 – 8 for each GCP project deployed in your Google Cloud account.

Remediation / Resolution

To ensure that your Google Cloud Tasks queues have optimal task dispatch rate limits configured, perform the following operations:

Using GCP Console

01 Sign in to your Trend Cloud One™ – Conformity account, access the Configure Rate Limits for Task Dispatches conformity rule settings and copy the rate limits (i.e., maxDispatchesPerSecond and maxConcurrentDispatches values) defined for the rule.

02 Sign in to the Google Cloud Management Console.

03 Select the Google Cloud Platform (GCP) project that you want to access from the console top navigation bar.

04 Navigate to Cloud Tasks Queues console available at https://console.cloud.google.com/cloudtasks to access the list of Cloud Tasks queues available for the selected GCP project.

05 Click on the name (link) of the queue that you want to configure and choose EDIT QUEUE from the top menu to modify the queue configuration.

06 In the Rate limits for task dispatches section, replace the existing values in the Max dispatches and Max concurrent dispatches fields with the maxDispatchesPerSecond and maxConcurrentDispatches values copied in step 1 to configure optimal and compliant rate limiting for the selected Cloud Tasks queue. Choose SAVE to apply the changes.

07 Repeat steps no. 5 and 6 for each Cloud Tasks queue that you want to configure, available within the selected GCP project.

08 Repeat steps no. 3 – 7 for each GCP project deployed in your Google Cloud account.

Using GCP CLI

01 Sign in to your Trend Cloud One™ – Conformity account, access the Configure Rate Limits for Task Dispatches conformity rule settings and copy the rate limits (i.e., maxDispatchesPerSecond and maxConcurrentDispatches values) defined for the rule.

02 Run tasks queues update command (OSX/Linux/UNIX) with the ID of the Cloud Tasks queue that you want to configure as the identifier parameter, to configure optimal rate limiting for the selected queue. Use the maxDispatchesPerSecond and maxConcurrentDispatches values copied in step 1 for the --max-dispatches-per-second and --max-concurrent-dispatches command parameters to set compliant rate limits:

gcloud tasks queues update projects/cc-web-project-123123/locations/us-central1/queues/cc-app-notification-queue
	--max-dispatches-per-second=100
	--max-concurrent-dispatches=300

03 The command output should return the update operation status:

Updated queue [us-central1/cc-app-notification-queue].

04 Repeat steps no. 2 and 3 for each Cloud Tasks queue that you want to configure, available in the selected GCP project.

05 Repeat steps no. 2 – 4 for each GCP project deployed in your Google Cloud account.

References

Publication date Mar 27, 2025