PHP 5는 지원이 종료되었으며 2026년 1월 31일에 지원 중단됩니다. 지원 중단 후에는 조직에서 이전에 조직 정책을 사용하여 레거시 런타임의 배포를 다시 사용 설정한 경우에도 PHP 5 애플리케이션을 배포할 수 없습니다. 기존 PHP 5 애플리케이션은 지원 중단 날짜 이후에도 계속 실행되고 트래픽을 수신합니다. 지원되는 최신 PHP 버전으로 마이그레이션하는 것이 좋습니다.
이 페이지에서는 push 큐를 만들고 맞춤설정하는 방법과 큐의 콘텐츠를 검사하는 방법을 설명합니다.
큐 구성 파일을 사용하여 큐 만들기
태스크를 처리하려면 push 큐에 추가해야 합니다. App Engine은 default라고 하는 기본 push 큐를 제공하며 이 큐는 기본 설정으로 구성되어 바로 사용할 수 있습니다. 원하는 경우 다른 큐를 만들고 구성할 필요 없이 모든 태스크를 기본 큐에 추가할 수 있습니다.
큐를 추가하거나 기본 구성을 변경하려면 App Engine에 업로드할 애플리케이션의 큐 구성 파일을 수정합니다. 큐를 최대 100개까지 만들 수 있습니다. 큐를 동적으로 만들 수 없습니다.
큐 구성 파일을 사용하여 태스크 데이터가 모든 큐에서 사용할 수 있는 총 스토리지를 정의할 수 있습니다. 총 스토리지 한도를 정의하려면 최상위 수준에 total_storage_limit라고 하는 요소를 포함합니다.
# Set the total storage limit for all queues to 120MBtotal_storage_limit: 120Mqueue:- name: queue-blue rate: 35/s
값은 숫자 뒤에 단위가 표시됩니다. B는 바이트, K는 킬로바이트, M는 메가바이트, G는 기가바이트, T는 테라바이트입니다. 예를 들어 100K는 100킬로바이트의 한도를 지정합니다. 태스크 추가로 인해 큐가 스토리지 한도를 초과하게 되는 경우 태스크를 추가하기 위한 호출이 실패합니다. 무료 앱의 기본 한도는 500M(500메가바이트)입니다. 결제가 설정된 앱은 명시적으로 한도를 설정하지 않으면 한도가 없습니다. 이 한도를 사용하여 각 태스크애서 실행 중에 여러 다른 태스크를 추가하는 포크 폭탄(fork bomb) 프로그래밍 오류로부터 앱을 보호할 수 있습니다.
태스크를 추가할 때 할당량 부족으로 앱에서 오류를 수신하는 경우 총 스토리지 한도를 늘리면 도움이 됩니다. 이 기능을 사용할 때는 반드시 며칠 분량의 태스크에 필요한 스토리지에 해당하는 한도를 설정하는 것이 좋습니다. 이렇게 하면 큐가 임시로 백업되고 백로그를 통해 작업하면서 새로운 태스크를 계속 받을 수 있는 동시에 포크 폭탄 프로그래밍 오류로부터도 보호됩니다.
[[["이해하기 쉬움","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, and processing rate, allowing customization of each queue's behavior.\u003c/p\u003e\n"],["\u003cp\u003eYou can control the processing rate of tasks using directives like \u003ccode\u003erate\u003c/code\u003e, \u003ccode\u003ebucket_size\u003c/code\u003e, and \u003ccode\u003emax_concurrent_requests\u003c/code\u003e, utilizing a token bucket system to manage task execution.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003etotal_storage_limit\u003c/code\u003e parameter in the queue configuration file allows setting a storage limit for all queues, helping prevent issues like fork bombs, and can help resolve quota issues by increasing the limit.\u003c/p\u003e\n"],["\u003cp\u003eQueues can be monitored in the Cloud Tasks page of the Google Cloud console, where you can view a list of queues and their details, including all tasks in a selected queue.\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| php-gen2\n|\n| /services/access). If you are updating to the App Engine PHP 7/8 runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/php-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/php/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/php/config/queueref#rate),\n[`bucket_size`](/appengine/docs/legacy/standard/php/config/queueref#bucket_size),\nand\n[`max_concurrent_requests`](/appengine/docs/legacy/standard/php/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/php/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/php/taskqueue/push/creating-tasks)."]]