You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: browsers/pools/overview.mdx
+15-5Lines changed: 15 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,17 +11,27 @@ Browser pools are a way to pre-configure a fixed set of browsers without being c
11
11
12
12
<Steps>
13
13
<Steptitle="Declare a pool">
14
-
First, declare a pool of browsers with your specified configuration. The pool takes time to fill (see [fill rate per minute](https://www.kernel.sh/docs/api-reference/browser-pools/create-a-browser-pool#body-fill-rate-per-minute)), so declare your pool outside your browser automation / agent runtime logic. Pool declarations should be decoupled from browser use logic for the best performance.
14
+
First, declare a pool of browsers with your specified configuration. The pool takes time to fill (see [fill rate per minute](https://www.kernel.sh/docs/api-reference/browser-pools/create-a-browser-pool#body-fill-rate-per-minute)), so declare your pool outside your browser automation / agent runtime logic.
15
+
16
+
<Info>
17
+
Pool declarations should be decoupled from browser runtime logic for the best performance.
18
+
</Info>
15
19
</Step>
16
20
<Steptitle="Acquire a browser">
17
-
You can acquire a browser as soon as you've created a pool. The request returns immediately if a browser is available, or waits until one becomes available. The `acquire_timeout_seconds` parameter controls how long to wait for a browser; it defaults to the calculated time it would take to fill the pool at the pool's configured [fill rate](https://www.kernel.sh/docs/api-reference/browser-pools/create-a-browser-pool#body-fill-rate-per-minute).
21
+
You can acquire a browser as soon as you've created a pool. The request returns immediately if a browser is available, or waits until one becomes available.
18
22
19
-
The total number of usable browsers is fixed to the `size` specified upon browser pool creation.
23
+
The total number of browsers is fixed to the `size` specified upon browser pool creation. When you acquire a browser, the pool's available count is decremented by one. When you release a browser, the pool's available count is incremented by one.
20
24
21
-
When you acquire a browser, the pool's available count is decremented by one. When you release a browser, the pool's available count is incremented by one. put differently, the pool does not top up when you acquire a browser: browsers are "borrowed" from the pool and must be returned when you're done with them, either by [releasing them](#release-a-browser) or allowing them to [timeout](#timeout-behavior).
25
+
<Info>
26
+
Put differently, the pool does not top up when you acquire a browser: browsers are "borrowed" from the pool and must be returned when you're done with them, either by [releasing them](#release-a-browser) or allowing them to [timeout](#timeout-behavior).
27
+
</Info>
22
28
</Step>
23
29
<Steptitle="Release a browser">
24
-
When you're done with a browser, release it back to the pool. this step is important; otherwise, the browser will continue to be in an `acquired` state until it [times out](#timeout-behavior). Failing to release browsers may result in unexpected latency when acquiring future browsers if the pool is only refilling when browsers timeout.
30
+
When you're done with a browser, release it back to the pool. this step is important; otherwise, the browser will continue to be in an `acquired` state until it times out.
31
+
32
+
<Info>
33
+
Failing to release browsers may result in unexpected latency when acquiring future browsers.
0 commit comments