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,47 @@
---
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, up from the previous limit of 2. This allows you to launch more browser tasks from [Cloudflare Workers](/workers). We'll continue to work on increasing the number of concurrent browsers as the Browser Rendering beta progresses.
elithrar marked this conversation as resolved.
Show resolved Hide resolved

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>
14 changes: 10 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,13 @@ sidebar:
order: 30
---

- Two new browsers per minute per account.
- Two 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 | 2 per account [^1] |
elithrar marked this conversation as resolved.
Show resolved Hide resolved
| New browser instances per minute | 2 per minute [^1] |
elithrar marked this conversation as resolved.
Show resolved Hide resolved
elithrar marked this conversation as resolved.
Show resolved Hide resolved
| Browser timeout | 60 seconds [^1][^2] |

[^1]: This limit will be reviewed and revised during the open beta for Browser Rendering.
elithrar marked this conversation as resolved.
Show resolved Hide resolved
[^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.
Loading