Go 1.11 はサポートが終了しており、2026 年 1 月 31 日に非推奨になります。非推奨になると、過去に組織のポリシーを使用して以前のランタイムのデプロイを再度有効にしていた場合でも、Go 1.11 アプリケーションをデプロイできなくなります。既存の Go 1.11 アプリケーションは、非推奨日以降も引き続き実行され、トラフィックを受信します。サポートされている最新バージョンの Go に移行することをおすすめします。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[[["\u003cp\u003ePush queues are used to process tasks, and while App Engine provides a default queue, you can create up to 100 custom queues by editing the application's queue configuration file.\u003c/p\u003e\n"],["\u003cp\u003eThe queue configuration file can define parameters such as the queue's name, target module, processing rate, and the total storage limit across all queues.\u003c/p\u003e\n"],["\u003cp\u003eThe processing rate of tasks in each queue can be controlled using directives like \u003ccode\u003erate\u003c/code\u003e, \u003ccode\u003ebucket_size\u003c/code\u003e, and \u003ccode\u003emax_concurrent_requests\u003c/code\u003e, with the task queue using a token bucket system to manage task execution.\u003c/p\u003e\n"],["\u003cp\u003eYou can set a \u003ccode\u003etotal_storage_limit\u003c/code\u003e in the queue configuration file to prevent tasks from consuming too much storage, and this is especially important to avoid fork bomb programming errors.\u003c/p\u003e\n"],["\u003cp\u003eThe Google Cloud console's Cloud Tasks page allows you to monitor all queues in your application and view the details of tasks within each queue, despite App Engine retaining its task queue functionality.\u003c/p\u003e\n"]]],[],null,["# Creating Push Queues\n\nThis page describes how to create and customize a push queue, and how to\nexamine the contents of a queue.\n| This API is supported for first-generation runtimes and can be used when [upgrading to corresponding second-generation runtimes](/appengine/docs/standard/\n| go\n| /services/access). If you are updating to the App Engine Go 1.12+ runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/go-differences) to learn about your migration options for legacy bundled services.\n\nUsing a queue configuration file to create queues\n-------------------------------------------------\n\nTo process a task, you must add it to a push queue. App Engine provides a\ndefault push queue, named `default`, which is configured and\nready to use with default settings. If you want, you can just add all your tasks\nto the default queue, without having to create and configure other queues.\n\nTo add queues or change the default configuration, edit the queue configuration file\nfor your application, which you upload to App Engine. You can create up to 100\nqueues. Queues cannot be created dynamically.\n\nThis queue configuration file defines two queues: \n\n queue:\n - name: queue-blue\n target: v2.task-module\n rate: 5/s\n\n - name: queue-red\n rate: 1/s\n\nTo upload the file: \n\n gcloud app deploy queue.yaml\n\n| **Note:** Your app should not assume App Engine processes tasks in a queue in the order in which they were enqueued.\n\nAll tasks added to `queue-blue` are sent to the target module `v2.task-module`.\nThe refresh rate of `queue-red` is changed from 5/s to 1/s. Tasks will be\ndequeued and sent to their targets at the rate of 1 task per second.\n\nIf you delete a queue, you must wait approximately 7 days before creating\na new queue with the same name.\n\nThere are many other parameters that can be added to the configuration file to\ncustomize the behavior of a push queue. For more information, see the\n[queue configuration file reference](/appengine/docs/legacy/standard/go111/config/queueref).\n| **Note:** If you are using a service account to manage authentication for deploying your queue configuration file, it needs to have the `serviceusage.services.list` permission. This permission can be added either using the [`serviceusage.serviceUsageViewer`](/iam/docs/understanding-roles#service-usage-roles) role or by creating a [custom role](/iam/docs/understanding-custom-roles) with that permission.\n\nDefining the push queue processing rate\n---------------------------------------\n\n\nYou can control the rate at which tasks are processed in each of your queues by\ndefining other directives, such as\n[`rate`](/appengine/docs/legacy/standard/go111/config/queueref#rate),\n[`bucket_size`](/appengine/docs/legacy/standard/go111/config/queueref#bucket_size),\nand\n[`max_concurrent_requests`](/appengine/docs/legacy/standard/go111/config/queueref#max_concurrent_requests).\n\nThe task queue uses [token buckets](https://wikipedia.org/wiki/Token_bucket) to\ncontrol the rate of task execution. Each named queue has a token bucket that\nholds tokens, up to the maximum specified by the `bucket_size`, or a maximum of\n5 tokens if you don't specify the bucket size.\n\nEach time your application executes a task, a token is removed from the bucket.\nYour app continues processing tasks in the queue until the queue's bucket runs\nout of tokens. App Engine refills the bucket with new tokens continuously based\non the `rate` that you specified for the queue.\n\nIf your queue contains tasks to process, and the queue's bucket contains tokens,\nApp Engine simultaneously processes as many tasks as there are tokens.\nThis can lead to bursts of processing, consuming system resources and competing\nwith user-serving requests.\n\nIf you want to prevent too many tasks from running at once or to prevent\ndatastore contention, use `max_concurrent_requests`.\n\nThe following sample shows how to set `max_concurrent_requests` to limit\ntasks and also shows how to adjust the bucket size and rate based on your\napplication's needs and available resources: \n\n queue:\n - name: queue-blue\n rate: 20/s\n bucket_size: 40\n max_concurrent_requests: 10\n\nSetting storage limits for all queues\n-------------------------------------\n\nYou can use your queue configuration file to define the total amount of storage that task data\ncan consume over all queues. To define the total storage limit, include an\nelement named [`total_storage_limit`](/appengine/docs/legacy/standard/go111/config/queueref#total_storage_limit)\nat the top level: \n\n # Set the total storage limit for all queues to 120MB\n total_storage_limit: 120M\n queue:\n - name: queue-blue\n rate: 35/s\n\nThe value is a number followed by a unit: `B` for bytes, `K` for kilobytes, `M`\nfor megabytes, `G` for gigabytes, `T` for terabytes. For example, `100K`\nspecifies a limit of 100 kilobytes. If adding a task would cause the queue to\nexceed its storage limit, the call to add the task will fail. The default limit\nis `500M` (500 megabytes) for free apps. For billed apps there is no limit until\nyou explicitly set one. You can use this limit to protect your app from a [fork\nbomb](https://wikipedia.org/wiki/Fork_bomb)\nprogramming error in which each task adds multiple other tasks during its\nexecution.\n\nIf your app is receiving errors for insufficient quota when adding\ntasks, increasing the total storage limit can help. If you are using this\nfeature, we strongly recommend setting a limit that corresponds to the storage\nrequired for several days' worth of tasks. This allows the queues to be\ntemporarily backed up and continue to accept new tasks\nwhile working through the backlog while still being protected from a fork bomb\nprogramming error.\n\nMonitoring queues in the Google Cloud console\n---------------------------------------------\n\n1. In the Google Cloud console, go to the Cloud Tasks page.\n\n [Go to **Cloud Tasks**](https://console.cloud.google.com/cloudtasks)\n\n Note that if you go to the App Engine **Task queue** page, there\n will be instructions that guide you to the Cloud Tasks page.\n This update in the Google Cloud console does not change how Task queues\n function.\n2. Enable the Cloud Tasks API.\n\n3. Once you're in the Cloud Tasks page, you will see a list of all\n of the queues in the application. Clicking on a the name of a queue brings up\n the **Queue Details** page, which shows all of the tasks in the selected queue.\n\nWhat's next\n-----------\n\nLearn about [creating tasks](/appengine/docs/legacy/standard/go111/taskqueue/push/creating-tasks)."]]