Skip to content

Commit 6204f6e

Browse files
penalosaToriLindsayhyperlint-ai[bot]irvinebroque
authored andcommitted
Add wrangler check startup docs (#19877)
* Add check startup docs * Update src/content/docs/workers/wrangler/commands.mdx Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Brendan Irvine-Broque <[email protected]> Co-authored-by: ToriLindsay <[email protected]> * Update commands.mdx * fix link --------- Co-authored-by: ToriLindsay <[email protected]> Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com> Co-authored-by: Brendan Irvine-Broque <[email protected]>
1 parent 03ed65f commit 6204f6e

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/content/docs/workers/platform/limits.mdx

+2
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,8 @@ You can measure your Worker's startup time by deploying it to Cloudflare using [
272272

273273
If you are having trouble staying under this limit, consider [profiling using DevTools](/workers/observability/dev-tools/) locally to learn how to optimize your code.
274274

275+
When you attempt to deploy a Worker using the [Wrangler CLI](/workers/wrangler/), but your deployment is rejected because your Worker exceeds the maximum startup time, Wrangler will automatically generate a CPU profile that you can import into Chrome DevTools or open directly in VSCode. You can use this to learn what code in your Worker uses large amounts of CPU time at startup. Refer to [`wrangler check startup`](/workers/wrangler/commands/#startup) for more details.
276+
275277
<Render file="limits_increase" />
276278

277279
---

src/content/docs/workers/wrangler/commands.mdx

+26
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Wrangler offers a number of commands to manage your Cloudflare Workers.
4848
- [`cert`](#cert) - Manage certificates used for mTLS and Certificate Authority (CA) chain connections.
4949
- [`types`](#types) - Generate types from bindings and module rules in configuration.
5050
- [`telemetry`](#telemetry) - Configure whether Wrangler can collect anonymous usage data.
51+
- [`check`](#check) - Validate your Worker.
5152

5253
:::note
5354

@@ -1966,3 +1967,28 @@ This will resolve the global status set by `wrangler telemetry disable / enable`
19661967
```txt
19671968
wrangler telemetry status
19681969
```
1970+
1971+
<Render file="wrangler-commands/global-flags" product="workers" />
1972+
1973+
---
1974+
1975+
## `check`
1976+
1977+
### `startup`
1978+
1979+
Generate a CPU profile of your Worker's startup phase.
1980+
1981+
After you run `wrangler check startup`, you can import the profile into Chrome DevTools or open it directly in VSCode to view a flamegraph of your Worker's startup phase. Additionally, when a Worker deployment fails with a startup time error Wrangler will automatically generate a CPU profile for easy investigation.
1982+
1983+
```sh
1984+
wrangler check startup
1985+
```
1986+
1987+
- `--args` <Type text="string" /> <MetaInfo text="optional" />
1988+
- To customise the way `wrangler check startup` builds your Worker for analysis, provide the exact arguments you use when deploying your Worker with `wrangler deploy`, or your Pages project with `wrangler pages functions build`. For instance, if you deploy your Worker with `wrangler deploy --no-bundle`, you should use `wrangler check startup --args="--no-bundle"` to profile the startup phase.
1989+
- `--worker` <Type text="string" /> <MetaInfo text="optional" />
1990+
- If you don't use Wrangler to deploy your Worker, you can use this argument to provide a Worker bundle to analyse. This should be a file path to a serialized multipart upload, with the exact same format as [the API expects](/api/resources/workers/subresources/scripts/methods/update/).
1991+
- `--pages` <Type text="boolean" /> <MetaInfo text="optional" />
1992+
- If you don't use a Wrangler config file with your Pages project (i.e. a Wrangler config file containing `pages_build_output_dir`), use this flag to force `wrangler check startup` to treat your project as a Pages project.
1993+
1994+
<Render file="wrangler-commands/global-flags" product="workers" />

0 commit comments

Comments
 (0)