Go 1.11 has reached end of support
and will be deprecated
on January 31, 2026. After deprecation, you won't be able to deploy Go 1.11
applications, even if your organization previously used an organization policy to
re-enable deployments of legacy runtimes. Your existing Go
1.11 applications will continue to run and receive traffic after their
deprecation date. We
recommend that you migrate to the latest supported version of Go.
Stay organized with collections
Save and categorize content based on your preferences.
Region ID
The REGION_ID is an abbreviated code that Google assigns
based on the region you select when you create your app. The code does not
correspond to a country or province, even though some region IDs may appear
similar 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.
The queue.yaml configuration file is used to create and configure almost all
of the task queues
(push or pull)
your app uses. All App Engine apps come with
an automatically preconfigured push queue named default. Although you do not
create the default queue yourself, you can add other queues or change the
configuration of the default queue using the queue.yaml file.
To configure push queues, you can use either queue.yaml or
Queue Management methods from Cloud Tasks, but
not both at the same time. Mixing the
queue.yaml upload method with Queue Management methods can produce unexpected
results and is not recommended.
To configure pull queues, you must use the queue.yaml file.
Example
The following a basic example that defines a named queue and overrides the
default processing rate:
queue:
- name: my-push-queue
rate: 1/s
The following is a more complex example of a queue.yaml configuration that
demonstrates setting up the number of task tries and modifying the default processing rate.
The queue.yaml file is a YAML file whose root directive is queue.
This directive contains zero or more named queues. Each queue definition can
specify the following elements:
Element
Description
bucket_size (push queues)
Optional. A task queue uses the token 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 the bucket_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 specify bucket_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 processing
rate.
For more information on this element, see the comparative description of
max_burst_size
in the Cloud Tasks API reference.
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
max_concurrent_dispatches in the Cloud Tasks API reference.
mode
Optional.
Identifies the queue mode. This setting defaults to push,
which identifies a queue as a push
queue. If you wish to use pull
queues, set the mode to pull.
name
Required.
The name of the queue.
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
the Google 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 queue.yaml file.
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
s for seconds, m for minutes, h
for hours, or d for days. For example, the value
5/m says tasks will be processed at a rate of 5 times per
minute. The maximum value for rate is 500/s.
If the number is 0 (such as 0/s), the queue
is considered "paused," and no tasks are processed.
For more information on this element, see the comparative description of
max_dispatches_per_second in the Cloud Tasks API reference.
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:
task_retry_limit
The number of retries. For example, if 0 is specified
and the task fails, the task is not retried at
all. If 1 is specified and the task fails, the
task is retried once. If this parameter is unspecified, the task is
retried indefinitely. If task_retry_limit is specified
with task_age_limit, the task is retried until both
limits are reached.
task_age_limit (push queues)
The time limit for retrying a failed task, measured from when the
task was first run. The value is a number followed by a unit of
time, where the unit is s for seconds, m
for minutes, h for hours, or d for days.
For example, the value 5d specifies a limit of five
days after the task's first execution attempt. If this parameter
is unspecified, the task is retried indefinitely. If specified with
task_retry_limit, App Engine retries the task until
both limits are reached.
min_backoff_seconds (push queues)
The minimum number of seconds to wait before retrying a task after
it fails. The default value is 0.1.
max_backoff_seconds (push queues)
The maximum number of seconds to wait before retrying a task after
it fails. The default value is 3600.
max_doublings (push queues)
The maximum number of times that the interval between failed task
retries will be doubled before the increase becomes constant. The
constant is: 2**max_doublings * min_backoff_seconds.
The default value is 16.
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 my-app and you set the target to
my-version-dot-my-service, the URL hostname will be set to
my-version-dot-my-service-dot-my-app.REGION_ID.r.appspot.com.
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 a dispatch
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:
B (bytes)
K (kilobytes)
M (megabytes)
G (gigabytes)
T (terabytes)
If
total_storage_limit
exceeds the total disk storage that is available to an application,
the limit is capped at the available storage.
Deploying the queue configuration file
The queue.yaml file should reside in your source code directory with your
application code, for example, with the .go file.
To deploy the queue configuration file, run the following command:
gcloud app deploy queue.yaml
Deleting queues
To delete a queue:
Remove the queue definition from your queue.yaml file.
Upload the change to your queue.yaml file.
gcloud app deploy queue.yaml
Delete the queue in the Google Cloud console, select the queue and click
Delete queue:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eThe \u003ccode\u003equeue.yaml\u003c/code\u003e file is used to configure both push and pull task queues, with all App Engine apps having a preconfigured \u003ccode\u003edefault\u003c/code\u003e push queue.\u003c/p\u003e\n"],["\u003cp\u003ePush queues can be configured using either \u003ccode\u003equeue.yaml\u003c/code\u003e or Queue Management methods from Cloud Tasks, but using both methods simultaneously is not recommended due to potential unexpected outcomes.\u003c/p\u003e\n"],["\u003cp\u003eEach queue defined in \u003ccode\u003equeue.yaml\u003c/code\u003e can be customized with elements like \u003ccode\u003erate\u003c/code\u003e, \u003ccode\u003eretry_parameters\u003c/code\u003e, \u003ccode\u003ebucket_size\u003c/code\u003e, and \u003ccode\u003emax_concurrent_requests\u003c/code\u003e to manage task processing and retry behavior.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eREGION_ID\u003c/code\u003e is a Google-assigned code based on the region selected when creating an app, included in App Engine URLs for apps created after February 2020.\u003c/p\u003e\n"],["\u003cp\u003eDeleting a queue requires removing it from the \u003ccode\u003equeue.yaml\u003c/code\u003e file, deploying the updated file, and then deleting it in the Google Cloud console; there is a 7-day waiting period before recreating a queue with the same name.\u003c/p\u003e\n"]]],[],null,["# queue.yaml Reference\n\n### Region ID\n\nThe \u003cvar translate=\"no\"\u003eREGION_ID\u003c/var\u003e is an abbreviated code that Google assigns\nbased on the region you select when you create your app. The code does not\ncorrespond to a country or province, even though some region IDs may appear\nsimilar to commonly used country and province codes. For apps created after\nFebruary 2020, \u003cvar translate=\"no\"\u003eREGION_ID\u003c/var\u003e`.r` is included in\nApp Engine URLs. For existing apps created before this date, the\nregion ID is optional in the URL.\n\nLearn more\n[about region IDs](/appengine/docs/legacy/standard/go111/how-requests-are-routed#region-id). \nOK\n\nThe `queue.yaml` configuration file is used to create and configure almost all\nof the task queues\n\n([push](/appengine/docs/legacy/standard/go111/taskqueue/push) or [pull](/appengine/docs/legacy/standard/go111/taskqueue/pull))\n\nyour app uses. All App Engine apps come with\nan automatically preconfigured push queue named `default`. Although you do not\ncreate the `default` queue yourself, you can add other queues or change the\nconfiguration of the `default` queue using the `queue.yaml` file.\n\n\u003cbr /\u003e\n\nTo configure push queues, you can use either `queue.yaml` or\n[Queue Management](/tasks/docs/queue-yaml) methods from Cloud Tasks, but\n[not both](/tasks/docs/queue-yaml#pitfalls) at the same time. Mixing the\n`queue.yaml` upload method with Queue Management methods can produce unexpected\nresults and is not recommended.\nTo configure pull queues, you must use the `queue.yaml` file.\n\n\u003cbr /\u003e\n\n| **Caution:** Uploading a `queue.yaml` file via the gcloud CLI below version `332.0.0` uses a deprecated interface to the service. Starting on `2022-09-20`, attempts to use the upload method can fail with server errors. To resolve this, make sure the Cloud Tasks API is enabled in your project and your gcloud CLI is updated to at least version `332.0.0`.\n\nExample\n-------\n\nThe following a basic example that defines a named queue and overrides the\ndefault processing rate: \n\n queue:\n - name: my-push-queue\n rate: 1/s\n\nThe following is a more complex example of a `queue.yaml` configuration that\ndemonstrates setting up the number of task tries and modifying the default processing rate. \n\n queue:\n - name: fooqueue\n rate: 1/s\n retry_parameters:\n task_retry_limit: 7\n task_age_limit: 2d\n - name: barqueue\n rate: 1/s\n retry_parameters:\n min_backoff_seconds: 10\n max_backoff_seconds: 200\n max_doublings: 0\n - name: bazqueue\n rate: 1/s\n retry_parameters:\n min_backoff_seconds: 10\n max_backoff_seconds: 200\n max_doublings: 3\n\nSyntax\n------\n\nThe `queue.yaml` file is a YAML file whose root directive is `queue`.\nThis directive contains zero or more named queues. Each queue definition can\nspecify the following elements:\n\nThe following elements can be specified for all queues within an app:\n\nDeploying the queue configuration file\n--------------------------------------\n\nThe `queue.yaml` file should reside in your source code directory with your application code, for example, with the `.go` file.\n\nTo deploy the queue configuration file, run the following command: \n\n gcloud app deploy queue.yaml\n\nDeleting queues\n---------------\n\nTo delete a queue:\n\n1. Remove the queue definition from your `queue.yaml` file.\n\n2. Upload the change to your `queue.yaml` file.\n\n gcloud app deploy queue.yaml\n3. Delete the queue in the Google Cloud console, select the queue and click\n **Delete queue**:\n\n [Go to the Task queues page](https://console.cloud.google.com/appengine/taskqueues)\n\nIf you delete a queue from the Google Cloud console, you must wait 7 days\nbefore recreating with the same name."]]