Skip to content
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

browser rendering limits #19566

Merged
merged 7 commits into from
Jan 31, 2025
Merged
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: More concurrent Br
description: Browser Rendering now supports more concurrent browser sessions.
products:
- workers
- browser-rendering
date: 2025-01-30T13:00:00Z
---

import { Render, PackageManagers, TypeScriptExample } from "~/components"

[Browser Rendering](/browser-rendering/) now supports 10 concurrent browser instances per account _and_ 10 new instances per minute, up from the previous limits of 2.

This allows you to launch more browser tasks from [Cloudflare Workers](/workers).

To manage concurrent browser sessions, you can use [Queues](/queues/) or [Workflows](/workflows/):

<TypeScriptExample filename="index.ts">

```ts
interface QueueMessage {
url: string;
waitUntil: number;
}

export interface Env {
BROWSER_QUEUE: Queue<QueueMessage>;
BROWSER: Fetcher;
}

export default {
async queue(batch: MessageBatch<QueueMessage>, env: Env): Promise<void> {
for (const message of batch.messages) {
const browser = await puppeteer.launch(env.BROWSER);
const page = await browser.newPage();

try {
await page.goto(message.url, {
waitUntil: message.waitUntil
});
// Process page...
} finally {
await browser.close();
}
}
}
};
```
</TypeScriptExample>
15 changes: 11 additions & 4 deletions src/content/docs/browser-rendering/platform/limits.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ sidebar:
order: 30
---

- 10 new browsers per minute per account.
- 10 concurrent browsers per account.
- By default, a browser instance gets killed if it does not get any [devtools](https://chromedevtools.github.io/devtools-protocol/) command for 60 seconds, freeing one instance. Users can optionally increase this by using the `keep_alive` [option](/browser-rendering/platform/puppeteer/#keep-alive).
- `browser.close()` releases the browser instance.
import { Render } from "~/components"

| Feature | Limit |
| --------------------------------------------- | ------------------------------------------------------------- |
| Concurrent browsers per account | 10 per account [^1] |
| New browser instances per minute | 10 per minute [^1] |
| Browser timeout | 60 seconds [^1][^2] |

[^1]: Contact our team to request increases to this limit.
[^2]: By default, a browser instance gets killed if it does not get any [devtools](https://chromedevtools.github.io/devtools-protocol/) command for 60 seconds, freeing one instance. Users can optionally increase this by using the `keep_alive` [option](/browser-rendering/platform/puppeteer/#keep-alive). `browser.close()` releases the browser instance.
close()` releases the browser instance.
Loading