Hi everyone,
I'm working on a multiplayer game in Construct 3 where I've implemented a custom WebSocket plugin for handling connections instead of the built-in Multiplayer plugin.
The setup involves running dedicated "hosts" for different rooms on a server, using Playwright (Node.js) to launch headless Chromium instances that load the game's index.html and act as the host.
Basic flow:
Each room is created by launching a new browser instance, navigating to the game URL with a room parameter (e.g. index.html?name=room1), and letting the game handle the WebSocket server logic inside Construct.
Clients connect via WebSocket to these hosts.
This works fine for a single room:
Idle RAM: ~400–600 MB per instance
CPU usage: ~4%
However, when scaling to 2+ rooms, resource usage skyrockets:
The second room pushes CPU usage to ~40%.
By the third room, the server (an 8-CPU VPS) starts slowing down significantly.
Even with optimizations like --disable-gpu, --disable-webgl, a very small viewport (1×1), and disabling unnecessary Chromium features, each additional instance increases CPU usage exponentially instead of linearly.
There are no clients connected yet — these are just idle hosts.
Has anyone successfully run multiple dedicated hosts like this (using headless browsers or an alternative approach)?
What tools or architectures did you use?