-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Adds changelog entry for cpu_ms limit bump #21112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
08fe2ab
Adds changelog entry for cpu_ms limit bump
mikenomitch 5a18847
update limits page
rita3ko 06f2adc
Update src/content/changelog/workers/2025-03-25-higher-cpu-limits.mdx
rita3ko 46d362b
clarify wall clock vs cpu time
rita3ko 87a3a8a
mention workflows & queues
rita3ko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
src/content/changelog/workers/2025-03-25-higher-cpu-limits.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| --- | ||
| title: Run Workers for up to 5 minutes of CPU-time | ||
| description: Workers now support up to 5 minutes of CPU time per request. Allowing more CPU-intensive workloads. | ||
| products: | ||
| - workers | ||
| date: 2025-03-25T17:00:00Z | ||
| --- | ||
|
|
||
| import { Render, TypeScriptExample, WranglerConfig } from "~/components"; | ||
|
|
||
| You can now run a Worker for up to 5 minutes of CPU time for each request. | ||
|
|
||
| Previously, each Workers request ran for a maximum of 30 seconds of CPU time. This | ||
| meant that some compute-intensive tasks were impossible to do with a Worker. For instance, | ||
| a user might want to take the cryptographic hash of a large file from R2. If | ||
rita3ko marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| this computation ran for over 30 seconds, the Worker request would have timed out. | ||
|
|
||
| By default, Workers are still limited to 30 seconds of CPU time. This protects developers | ||
| from incurring accidental cost due to buggy code. | ||
|
|
||
| By changing the `cpu_ms` value in your Wrangler configuration, you can opt in to | ||
| any value up to 300,000 (5 minutes). | ||
|
|
||
| <WranglerConfig> | ||
|
|
||
| ```jsonc | ||
| { | ||
| // ...rest of your configuration... | ||
| "limits": { | ||
| "cpu_ms": 300000, | ||
| }, | ||
| // ...rest of your configuration... | ||
| } | ||
| ``` | ||
|
|
||
| </WranglerConfig> | ||
|
|
||
| :::note | ||
| CPU time is the amount of time the CPU actually spends doing work during a given request. | ||
| If a Worker's request makes a sub-request and waits for that request to come back before | ||
| doing additional work, this time spent waiting **is not** counted towards CPU time. | ||
|
|
||
| Worker requests could run for more than 30 seconds of total time prior to this change — only | ||
| CPU time was limited. | ||
| ::: | ||
|
|
||
| For more information, see the documentation on [Wrangler configuration for `cpu_ms`](/workers/wrangler/configuration/#limits) | ||
| and on [Workers CPU time limits](/workers/platform/limits/#cpu-time). | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...while duration (wall-time) is unlimited in workers
(Or something)