From fc151ce08cd537e862a268f2ab5353512102af41 Mon Sep 17 00:00:00 2001 From: Pranshu Maheshwari Date: Tue, 25 Mar 2025 13:30:41 -0400 Subject: [PATCH 1/4] Updated queues consumer cpu limits --- src/content/docs/queues/platform/limits.mdx | 57 ++++++++++++++------- 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/src/content/docs/queues/platform/limits.mdx b/src/content/docs/queues/platform/limits.mdx index 7f578909e484dbc..be40e406a2ea703 100644 --- a/src/content/docs/queues/platform/limits.mdx +++ b/src/content/docs/queues/platform/limits.mdx @@ -6,26 +6,26 @@ sidebar: --- -import { Render } from "~/components" +import { Render, WranglerConfig } from "~/components" -| Feature | Limit | -| --------------------------------------------- | ------------------------------------------------------------- | -| Queues | 10,000 per account | -| Message size | 128 KB 1 | -| Message retries | 100 | -| Maximum consumer batch size | 100 messages | -| Maximum messages per `sendBatch` call | 100 (or 256KB in total) | -| Maximum Batch wait time | 60 seconds | -| Per-queue message throughput | 5,000 messages per second 2 | -| Message retention period 3 | 14 days | -| Per-queue backlog size 4 | 25GB | -| Concurrent consumer invocations | 250 push-based only | -| Consumer duration (wall clock time) | 15 minutes 5 | -| Consumer CPU time | 30 seconds | -| `visibilityTimeout` (pull-based queues) | 12 hours | -| `delaySeconds` (when sending or retrying) | 12 hours | -| Requests to the Queues API (incl. pulls/acks) | [1200 requests / 5 mins](/fundamentals/api/reference/limits/) | +| Feature | Limit | +| ----------------------------------------------------------------| ------------------------------------------------------------- | +| Queues | 10,000 per account | +| Message size | 128 KB 1 | +| Message retries | 100 | +| Maximum consumer batch size | 100 messages | +| Maximum messages per `sendBatch` call | 100 (or 256KB in total) | +| Maximum Batch wait time | 60 seconds | +| Per-queue message throughput | 5,000 messages per second 2 | +| Message retention period 3 | 14 days | +| Per-queue backlog size 4 | 25GB | +| Concurrent consumer invocations | 250 push-based only | +| Consumer duration (wall clock time) | 15 minutes 5 | +| [Active Consumer CPU time]((/workers/platform/limits/#cpu-time))| 30 seconds (default). Configurable to 5 minutes of active CPU time | +| `visibilityTimeout` (pull-based queues) | 12 hours | +| `delaySeconds` (when sending or retrying) | 12 hours | +| Requests to the Queues API (incl. pulls/acks) | [1200 requests / 5 mins](/fundamentals/api/reference/limits/) | @@ -40,3 +40,24 @@ import { Render } from "~/components" 5 Refer to [Workers limits](/workers/platform/limits/#cpu-time). + +### Increasing Queue Consumer CPU limits +Queue consumers are Worker scripts, and share the same [per invocation CPU limits](/workers/platform/limits/#worker-limits) as any Workers do. Note that CPU time is active processing time: not time spent waiting on network requests, storage calls, or other general I/O, which don't count towards your CPU time or Workflows compute consumption. + +By default, the maximum CPU time per Workflow invocation is set to 30 seconds, but can be increased for all invocations associated with a Queue consumer by setting `limits.cpu_ms` in your Wrangler configuration: + + + +```jsonc +{ + // ...rest of your configuration... + "limits": { + "cpu_ms": 300000, // 300,000 milliseconds = 5 minutes + }, + // ...rest of your configuration... +} +``` + + + +To learn more about CPU time and limits, [review the Workers documentation](/workers/platform/limits/#cpu-time). \ No newline at end of file From 0ddc0d1d423d296a0cda54f29a65668e854bdf56 Mon Sep 17 00:00:00 2001 From: Pranshu Maheshwari Date: Tue, 25 Mar 2025 13:35:32 -0400 Subject: [PATCH 2/4] Updated typos in limits --- src/content/docs/queues/platform/limits.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/content/docs/queues/platform/limits.mdx b/src/content/docs/queues/platform/limits.mdx index be40e406a2ea703..170f0ead02aca4c 100644 --- a/src/content/docs/queues/platform/limits.mdx +++ b/src/content/docs/queues/platform/limits.mdx @@ -22,7 +22,7 @@ import { Render, WranglerConfig } from "~/components" | Per-queue backlog size 4 | 25GB | | Concurrent consumer invocations | 250 push-based only | | Consumer duration (wall clock time) | 15 minutes 5 | -| [Active Consumer CPU time]((/workers/platform/limits/#cpu-time))| 30 seconds (default). Configurable to 5 minutes of active CPU time | +| [Active Consumer CPU time]((/workers/platform/limits/#cpu-time))| 30 seconds (default). [Configurable to 5 minutes](/queues/platform/limits/#increasing-queue-consumer-worker-cpu-limits) | | `visibilityTimeout` (pull-based queues) | 12 hours | | `delaySeconds` (when sending or retrying) | 12 hours | | Requests to the Queues API (incl. pulls/acks) | [1200 requests / 5 mins](/fundamentals/api/reference/limits/) | @@ -41,10 +41,10 @@ import { Render, WranglerConfig } from "~/components" -### Increasing Queue Consumer CPU limits -Queue consumers are Worker scripts, and share the same [per invocation CPU limits](/workers/platform/limits/#worker-limits) as any Workers do. Note that CPU time is active processing time: not time spent waiting on network requests, storage calls, or other general I/O, which don't count towards your CPU time or Workflows compute consumption. +### Increasing Queue Consumer Worker CPU Limits +[Queue consumer Workers](/queues/reference/how-queues-works/#consumers) are Worker scripts, and share the same [per invocation CPU limits](/workers/platform/limits/#worker-limits) as any Workers do. Note that CPU time is active processing time: not time spent waiting on network requests, storage calls, or other general I/O. -By default, the maximum CPU time per Workflow invocation is set to 30 seconds, but can be increased for all invocations associated with a Queue consumer by setting `limits.cpu_ms` in your Wrangler configuration: +By default, the maximum CPU time per consumer Worker invocation is set to 30 seconds, but can be increased by setting `limits.cpu_ms` in your Wrangler configuration: From 11f8f62c442226e6b87999844b136b9f23882fd0 Mon Sep 17 00:00:00 2001 From: Pranshu Maheshwari Date: Tue, 25 Mar 2025 13:36:30 -0400 Subject: [PATCH 3/4] Fixed typo --- src/content/docs/queues/platform/limits.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/queues/platform/limits.mdx b/src/content/docs/queues/platform/limits.mdx index 170f0ead02aca4c..45997b5ac5caa4a 100644 --- a/src/content/docs/queues/platform/limits.mdx +++ b/src/content/docs/queues/platform/limits.mdx @@ -22,7 +22,7 @@ import { Render, WranglerConfig } from "~/components" | Per-queue backlog size 4 | 25GB | | Concurrent consumer invocations | 250 push-based only | | Consumer duration (wall clock time) | 15 minutes 5 | -| [Active Consumer CPU time]((/workers/platform/limits/#cpu-time))| 30 seconds (default). [Configurable to 5 minutes](/queues/platform/limits/#increasing-queue-consumer-worker-cpu-limits) | +| [Consumer CPU time]((/workers/platform/limits/#cpu-time))| 30 seconds (default). [Configurable to 5 minutes](/queues/platform/limits/#increasing-queue-consumer-worker-cpu-limits) | | `visibilityTimeout` (pull-based queues) | 12 hours | | `delaySeconds` (when sending or retrying) | 12 hours | | Requests to the Queues API (incl. pulls/acks) | [1200 requests / 5 mins](/fundamentals/api/reference/limits/) | From fda4f5021a4328bc4b0ce21defa85f7f0a092c7f Mon Sep 17 00:00:00 2001 From: Jun Lee Date: Tue, 25 Mar 2025 17:50:16 +0000 Subject: [PATCH 4/4] Update src/content/docs/queues/platform/limits.mdx --- src/content/docs/queues/platform/limits.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/queues/platform/limits.mdx b/src/content/docs/queues/platform/limits.mdx index 45997b5ac5caa4a..0cf93fd8344911d 100644 --- a/src/content/docs/queues/platform/limits.mdx +++ b/src/content/docs/queues/platform/limits.mdx @@ -22,7 +22,7 @@ import { Render, WranglerConfig } from "~/components" | Per-queue backlog size 4 | 25GB | | Concurrent consumer invocations | 250 push-based only | | Consumer duration (wall clock time) | 15 minutes 5 | -| [Consumer CPU time]((/workers/platform/limits/#cpu-time))| 30 seconds (default). [Configurable to 5 minutes](/queues/platform/limits/#increasing-queue-consumer-worker-cpu-limits) | +| [Consumer CPU time](/workers/platform/limits/#cpu-time)| 30 seconds (default). [Configurable to 5 minutes](/queues/platform/limits/#increasing-queue-consumer-worker-cpu-limits) | | `visibilityTimeout` (pull-based queues) | 12 hours | | `delaySeconds` (when sending or retrying) | 12 hours | | Requests to the Queues API (incl. pulls/acks) | [1200 requests / 5 mins](/fundamentals/api/reference/limits/) |