BF BotFoundry
BotFoundry / 8 Bot Blueprints / playwright-headless-scraper
BOTFOUNDRY CHROMIUM RUNBOOK • --SHM-SIZE=2G & TINI PID 1

BotFoundry Headless Playwright & Puppeteer /dev/shm Cluster Sizing Runbook

Docker’s default 64 MB /dev/shm partition and unreaped renderer subprocesses crash unhardened Playwright deployments within hours. Our BotFoundry model allocates 0.78 GB per active BrowserContext group, enforces shm_size: "2gb" plus init: true, and pairs worker pools with high-RAM DDR5 KVM or Ryzen servers.

Inspect Hostinger Specs for PW-SHM via BotFoundry → Compare InterServer Tiers via BotFoundry → Load Preset in BotFoundry RAM Sizer →

BotFoundry Deterministic vCPU, RAM & Guard Matrix (BP-03 // PW-SHM)

Public rates retrieved 2026-11-12 from official vendor pricing pages cited below; promotional & renewal prices may change — always verify exact specs, term length, and renewal rates on the vendor’s official checkout page.

Concurrency Scale vCPU DDR5 RAM OS / Runtime /dev/shm & Watchdog Guard Public Tier Match (2026-11-12)
1–4 Contexts 2 vCPU AMD EPYC 4 GB DDR5 Ubuntu 24.04 Docker shm_size: 1gb + init: true Hostinger KVM 1 ($4.99/mo)
8–12 Contexts 4 vCPU KVM 16 GB DDR5 Ubuntu 24.04 Docker shm_size: 2gb + Recycle 250 Hostinger KVM 4 ($10.49/mo)
20–35 Contexts 8 vCPU KVM / VDS 32 GB DDR5 Ubuntu 24.04 + BullMQ shm_size: 4gb + MaxOld=4096 Hostinger KVM 8 ($19.99/mo) / InterServer 32GB
60+ Stealth Contexts 12–16 Core Ryzen 64 GB DDR5 Bare-Metal Ubuntu 24.04 shm_size: 8gb + Swappiness=10 InterServer Ryzen 64GB ($89/mo)

BotFoundry Unattended Supervisor Snippet (BP-03 // PW-SHM)

BotFoundry Docker Chromium 64MB default /dev/shm crash vs --shm-size=2g and tini PID 1 zombie reaper diagram
BotFoundry Docker Chromium 64MB default /dev/shm crash vs --shm-size=2g and tini PID 1 zombie reaper diagram
docker-compose.yml — BotFoundry Playwright Worker with 2GB /dev/shm & Tini Reaper
services:
  pw-worker:
    image: mcr.microsoft.com/playwright:v1.49.0-noble
    init: true            # Tini PID 1 reaps orphaned Chromium renderer zombies
    shm_size: '2gb'       # Eliminates 64MB /dev/shm Target Closed crashes
    restart: unless-stopped
    environment:
      - NODE_OPTIONS=--max-old-space-size=4096
      - MAX_CONCURRENT_CONTEXTS=10
    deploy:
      resources:
        limits:
          memory: 12G
    command: ["node", "dist/worker.js"]
  1. 1. BotFoundry Crash Fix #1: Expand Docker /dev/shm from 64 MB to 2048 MB and Enable init: true

    Chromium’s Skia compositor and V8 IPC channels allocate shared memory frames inside /dev/shm; once a complex React storefront exceeds 64 MB, tabs throw "Target page, context or browser has been closed." Pairing shm_size: "2gb" with init: true reaps exited renderer PIDs immediately so RSS memory stays flat across weeks.

  2. 2. Multiplexing BrowserContexts Over One Chromium Binary in BotFoundry Worker Pools

    Calling chromium.launch() on every queued URL burns 280–450 MB of cold startup RAM. Launch one parent Chromium process per worker container, spawn isolated browser.newContext({ proxy }) tabs (~80–120 MB each), and recycle the parent binary cleanly every 250 completed tasks.

  3. 3. Aborting Media & Webfont Requests Cuts Proxy Bandwidth 65% in BotFoundry Models

    Intercept non-essential assets with page.route("**/*.{png,jpg,webp,mp4,woff2}", r => r.abort()) whenever visual screenshots are not required — halving CPU decode load on a $10.49/mo 16 GB Hostinger KVM 4 slice.

BotFoundry Troubleshooting & Sizing FAQ (BP-03 // PW-SHM)

Why does BotFoundry favor flat-rate KVM VPS over serverless functions for 24/7 Playwright?

Serverless 15-minute execution ceilings, cold Chromium binary decompression, and $0.09/GB cloud egress tariffs make continuous scraping 5x–8x costlier than a flat-rate 16 GB–32 GB KVM VPS on Hostinger or InterServer.

Does BotFoundry include a GPU requirement for headless Chromium DOM scraping?

No — pass --disable-gpu for HTML/JSON extraction. Only specialized WebGL canvas workflows require software SwiftShader threads, where high-core AMD EPYC or Ryzen CPUs excel.

What NVMe swap and vm.swappiness values does BotFoundry set on scraper nodes?

We provision a 4 GB NVMe swapfile with sysctl vm.swappiness=10 as an emergency shock absorber while enforcing strict concurrency caps in BullMQ.

Related BotFoundry Unattended Sizing Blueprints

Hostinger (BP-03 BotFoundry) From $4.99/mo
Inspect Specs on BotFoundry →