Skip to content

Commit d99b877

Browse files
committed
browser rendering limits
1 parent 13e8f68 commit d99b877

File tree

2 files changed

+57
-4
lines changed

2 files changed

+57
-4
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: More concurrent Br
3+
description: Browser Rendering now supports more concurrent browser sessions.
4+
products:
5+
- workers
6+
- browser-rendering
7+
date: 2025-01-30T13:00:00Z
8+
---
9+
10+
import { Render, PackageManagers, TypeScriptExample } from "~/components"
11+
12+
[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 your Workers. We'll continue to work on increasing the number of concurrent browsers as the Browser Rendering beta progresses.
13+
14+
To manage concurrent browser sessions, you can use [Queues](/queues/) or [Workflows](/workflows/):
15+
16+
<TypeScriptExample filename="index.ts">
17+
18+
```ts
19+
interface QueueMessage {
20+
url: string;
21+
waitUntil: number;
22+
}
23+
24+
export interface Env {
25+
BROWSER_QUEUE: Queue<QueueMessage>;
26+
BROWSER: Fetcher;
27+
}
28+
29+
export default {
30+
async queue(batch: MessageBatch<QueueMessage>, env: Env): Promise<void> {
31+
for (const message of batch.messages) {
32+
const browser = await puppeteer.launch(env.BROWSER);
33+
const page = await browser.newPage();
34+
35+
try {
36+
await page.goto(message.url, {
37+
waitUntil: message.waitUntil
38+
});
39+
// Process page...
40+
} finally {
41+
await browser.close();
42+
}
43+
}
44+
}
45+
};
46+
```
47+
</TypeScriptExample>

src/content/docs/browser-rendering/platform/limits.mdx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ sidebar:
55
order: 30
66
---
77

8-
- Two new browsers per minute per account.
9-
- Two concurrent browsers per account.
10-
- 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).
11-
- `browser.close()` releases the browser instance.
8+
import { Render } from "~/components"
9+
10+
| Feature | Limit |
11+
| --------------------------------------------- | ------------------------------------------------------------- |
12+
| Concurrent browsers per account | 2 per account [^1] |
13+
| New browser instances per minute | 2 per minute [^1] |
14+
| Browser timeout | 60 seconds [^1][^2] |
15+
16+
[^1]: This limit will be reviewed and revised during the open beta for Browser Rendering.
17+
[^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.

0 commit comments

Comments
 (0)