Limits
import { Render, Plan, Tabs, TabItem, DashButton } from "~/components";
Browser Run limits are based on your Cloudflare Workers plan.
For pricing information, refer to Browser Run pricing.
Workers Free
:::note[Need higher limits?]
If you are on a Workers Free plan and you want to increase your limits, upgrade to a Workers Paid plan in the Workers plans page of the Cloudflare dashboard:
:::
| Feature | Limit |
|---|---|
| Browser hours | 10 minutes per day |
| Concurrent browsers per account (Browser Sessions only) [^1] | 3 per account |
| New browser instances (Browser Sessions only) | 1 every 20 seconds |
| Browser timeout | 60 seconds [^2] |
| Total requests (Quick Actions only) [^3] | 1 every 10 seconds |
/crawl endpoint limits
The /crawl endpoint has additional limits for Workers Free plan users:
| Feature | Limit |
|---|---|
| Crawl jobs per day | 5 per day |
| Maximum pages per crawl | 100 pages |
Workers Paid
:::note[Need higher limits?] The limits below are defaults for Workers Paid users. If you need to scale beyond them, Cloudflare can increase your account limits. Request higher limits. :::
| Feature | Limit |
|---|---|
| Browser hours | No limit (See pricing) |
| Concurrent browsers per account (Browser Sessions only) [^1] | 200 per account (See pricing) |
| New browser instances per second (Browser Sessions only) | 3 per second |
| Browser timeout | 60 seconds [^2] |
| Total requests per second (Quick Actions only) [^3] | 30 per second |
[^1]: Browsers close upon task completion or sixty seconds of inactivity (if you do not extend your browser timeout). Therefore, in practice, many workflows do not require a high number of concurrent browsers.
[^2]: By default, a browser will time out after 60 seconds of inactivity. You can extend this to up to 20 minutes using the keep_alive option. Call browser.close() to release the browser instance immediately.
[^3]: If you exceed the per-second rate limit, you will receive a 429 response. Refer to troubleshooting the 429 Too many requests error.
FAQ
Can I increase the browser timeout?
By default, a browser instance will time out after 60 seconds of inactivity. If you want to keep the browser open longer, you can use the keep_alive option, which allows you to extend the timeout to up to 20 minutes.
Is there a maximum session duration?
There is no fixed maximum lifetime for a browser session as long as it remains active. By default, Browser Run closes sessions after one minute of inactivity to prevent unintended usage. You can increase this inactivity timeout to up to 20 minutes.
If you need sessions to remain open longer, keep them active by sending a command at least once within your configured inactivity window (for example, every 20 minutes). Sessions also close when Browser Run rolls out a new release.
I upgraded from the Workers Free plan, but I'm still hitting the 10-minute per day limit. What should I do?
If you recently upgraded to the Workers Paid plan but still encounter the 10-minute per day limit, redeploy your Worker to ensure your usage is correctly associated with the new plan.
Why is my browser usage higher than expected?
If you are hitting the daily limit or seeing higher usage than expected, the most common cause is browser sessions that are not being closed properly. When a browser session is not explicitly closed with browser.close(), it remains open and continues to consume browser time until it times out (60 seconds by default, or up to 20 minutes if you use the keep_alive option).
To minimize usage:
- Always call
browser.close()when you are finished with a browser session. - Wrap your browser code in a
try/finallyblock to ensurebrowser.close()is called even if an error occurs. - Use
puppeteer.history()orplaywright.history()to review recent sessions and identify any that closed due toBrowserIdleinstead ofNormalClosure. Sessions that close due to idle timeout indicate the browser was not closed explicitly.
You can monitor your usage and view session close reasons in the Cloudflare dashboard on the Browser Run page:
Refer to Browser close reasons for more information.
Troubleshooting
Error: 429 Too many requests
When you make too many requests in a short period of time, Browser Run will respond with HTTP status code 429 Too many requests. You can view your account's rate limits in the Workers Free and Workers Paid sections above.
The example below demonstrates how to handle rate limiting gracefully by reading the Retry-After value and retrying the request after that delay.
const response = await fetch('https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-run/content', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer <your-token>',
},
body: JSON.stringify({ url: 'https://example.com' })
});
if (response.status === 429) {
const retryAfter = response.headers.get('Retry-After');
console.log(`Rate limited. Waiting ${retryAfter} seconds...`);
await new Promise(resolve => setTimeout(resolve, retryAfter \* 1000));
// Retry the request
const retryResponse = await fetch(/* same request as above */);
}
import puppeteer from "@cloudflare/puppeteer";
try {
const browser = await puppeteer.launch(env.MYBROWSER);
const page = await browser.newPage();
await page.goto("https://example.com");
const content = await page.content();
await browser.close();
} catch (error) {
if (error.status === 429) {
const retryAfter = error.headers.get("Retry-After");
console.log(
`Browser instance limit reached. Waiting ${retryAfter} seconds...`,
);
await new Promise((resolve) => setTimeout(resolve, retryAfter * 1000));
// Retry launching browser
const browser = await puppeteer.launch(env.MYBROWSER);
}
}
Error: 429 Browser time limit exceeded for today
This Error processing the request: Unable to create new browser: code: 429: message: Browser time limit exceeded for today error indicates you have hit the daily browser limit on the Workers Free plan. Workers Free plan accounts are limited to 10 minutes of Browser Run usage per day. If you exceed that limit, you will receive a 429 error until the next UTC day.
You can increase your limits by upgrading to a Workers Paid plan on the Workers plans page of the Cloudflare dashboard:
If you recently upgraded but still encounter the 10-minute per day limit, redeploy your Worker to ensure your usage is correctly associated with the new plan.
谢谢你的反馈!