feat: multi-browser pooling (2 Chromium instances × 8 pages)

- Launch BROWSER_COUNT separate Chromium instances (default: 2)
- Each with PAGES_PER_BROWSER pages (default: 8, 16 total)
- Round-robin distribution across browser instances
- Independent restart scheduling per browser
- Updated health endpoint to show per-browser stats
- docker-compose: added BROWSER_COUNT and PAGES_PER_BROWSER env vars
This commit is contained in:
OpenClaw 2026-02-14 21:55:29 +00:00
parent a177020186
commit efa39661cf
6 changed files with 231 additions and 47 deletions

View file

@ -1,7 +1,21 @@
import { Router } from "express";
import { getPoolStats } from "../services/browser.js";
export const healthRouter = Router();
healthRouter.get("/", (_req, res) => {
res.json({ status: "ok", version: "0.1.0" });
const pool = getPoolStats();
res.json({
status: "ok",
version: "0.2.1",
pool: {
size: pool.poolSize,
active: pool.totalPages - pool.availablePages,
available: pool.availablePages,
queueDepth: pool.queueDepth,
pdfCount: pool.pdfCount,
restarting: pool.restarting,
uptimeSeconds: Math.round(pool.uptimeMs / 1000),
},
});
});