queue.yaml Reference Stay organized with collections Save and categorize content based on your preferences.
Region ID
TheREGION_ID is an abbreviated code that Google assignsbased on the region you select when you create your app. The code does notcorrespond to a country or province, even though some region IDs may appearsimilar to commonly used country and province codes. For apps created after February 2020,REGION_ID.r is included in App Engine URLs. For existing apps created before this date, the region ID is optional in the URL.
Learn moreabout region IDs.
Thequeue.yaml configuration file is used to create and configure almost allof the task queues (push orpull)your app uses. All App Engine apps come withan automatically preconfigured push queue nameddefault. Although you do notcreate thedefault queue yourself, you can add other queues or change theconfiguration of thedefault queue using thequeue.yaml file.
To configure push queues, you can use eitherqueue.yaml orQueue Management methods from Cloud Tasks, butnot both at the same time. Mixing thequeue.yaml upload method with Queue Management methods can produce unexpectedresults and is not recommended.
queue.yaml file.Caution: Uploading aqueue.yaml file via the gcloud CLI below version332.0.0 uses a deprecated interface to the service. Starting on2022-09-20, attempts to use the upload method can fail withserver errors. To resolve this, make sure the Cloud Tasks API is enabledin your project and your gcloud CLI is updated to at least version332.0.0.Example
The following a basic example that defines a named queue and overrides thedefault processing rate:
queue:-name:my-push-queuerate:1/sThe following is a more complex example of aqueue.yaml configuration thatdemonstrates setting up the number of task tries and modifying the default processing rate.
queue:-name:fooqueuerate:1/sretry_parameters:task_retry_limit:7task_age_limit:2d-name:barqueuerate:1/sretry_parameters:min_backoff_seconds:10max_backoff_seconds:200max_doublings:0-name:bazqueuerate:1/sretry_parameters:min_backoff_seconds:10max_backoff_seconds:200max_doublings:3Syntax
Thequeue.yaml file is a YAML file whose root directive isqueue.This directive contains zero or more named queues. Each queue definition canspecify the following elements:
| Element | Description |
|---|---|
bucket_size (push queues) | Optional. A task queue uses thetoken bucket algorithm to control the rate of task execution. Each named queue has a token bucket that holds tokens, up to the maximum specified by thebucket_size value. Each time your application executes a task, a token is removed from the bucket. You continue processing tasks in the queue until the queue's bucket runs out of tokens. App Engine refills the bucket with new tokens continuously based on the rate that you specified for the queue. The bucket size limits how fast the queue is processed when many tasks are in the queue and the rate is high. The maximum value for bucket size is 500. This allows you to have a high rate so processing starts shortly after a task is enqueued, but still limit resource usage when many tasks are enqueued in a short period of time. If you don't specifybucket_size for a queue, the default value is 5. We recommend that you set this to a larger value because the default size might be too small for many use cases. For example, you could determine your bucket size based on the processingrate. For more information on this element, see the comparative description of |
max_concurrent_requests (push queues) | Optional. Sets the maximum number of tasks that can be executed simultaneously from the specified queue. The value is an integer. By default, the limit is 1000 tasks per queue. The upper recommended limit is 5000 tasks per queue. Note that queues may slowly ramp up when they are first created or if they have been idle for a while. Restricting the number of concurrent tasks gives you more control over the queue's rate of execution and can prevent too many tasks from running at once. It can also prevent datastore contention and make resources available for other queues or online processing. For more information on this element, see the comparative description of |
mode | Optional. Identifies the queue mode. This setting defaults to |
name | Required. The name of the queue. This is the name you specify when you call A queue name can contain uppercase and lowercase letters, numbers, and hyphens. The maximum length for a queue name is 100 characters. All apps have a push queue named default. This queue has a preset rate of 5 tasks per second. Note that this default queue doesn't display in theGoogle Cloud console until the first time it is used or configured. You can configure the default queue, including changing the default rate, by defining a queue named `default` in your |
rate (push queues) | Required. How often tasks are processed on this queue. The value is a number followed by a slash and a unit of time, where the unit is If the number is For more information on this element, see the comparative description of |
retry_parameters | Optional. Configures retry attempts for failed tasks in push queues. This addition allows you to specify the maximum number of times to retry failed tasks in a specific queue. You can also set a time limit for retry attempts and control the interval between attempts. The retry parameters can contain the following subelements:
|
target (push queues) | Optional. A string naming a service/version, a frontend version, or a backend, on which to execute all of the tasks enqueued onto this queue. The default value is the empty string. The string is prepended to the domain name of your app when constructing the HTTP request for a task. For example, if your app ID is If target is unspecified, then tasks are invoked on the same version of the application where they were enqueued. So, if you enqueued a task from the default application version without specifying a target on the queue, the task is invoked in the default application version. Note that if the default application version changes between the time that the task is enqueued and the time that it executes, then the task will run in the new default version. If you are using services along with adispatch file, your task's HTTP request might be intercepted and re-routed to another service. |
The following elements can be specified for all queues within an app:
| Element | Description |
|---|---|
total_storage_limit | Optional. A string that overrides the default quota storage limit that is available for taskqueue storage (100M). For example: total_storage_limit:1.2Gqueue:-name:fooqueue This quota is part of the application's total storage quota (including the datastore and blobstore quota). If no suffix is specified, the number that you specify is interpreted as bytes. The following suffixes are supported:
If |
Deploying the queue configuration file
Thequeue.yaml file should reside in the root directory or in thedirectory that defines the default service.To deploy the queue configuration file, run the following command:
gcloudappdeployqueue.yamlDeleting queues
To delete a queue:
Remove the queue definition from your
queue.yamlfile.Upload the change to your
queue.yamlfile.gcloud app deploy queue.yaml
Delete the queue in the Google Cloud console, select the queue and clickDelete queue:
If you delete a queue from the Google Cloud console, you must wait 7 daysbefore recreating with the same name.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-15 UTC.