server icon indicating copy to clipboard operation
server copied to clipboard

fix: Solving problem that only limited number of CEF layers work in Docker environment. Fixes #1675

Open toontoet opened this issue 1 month ago • 1 comments

When running CasparCG in headless mode in Docker only limited number of html layers work (2 with gpu enabled, 4 without gpu).

This fix increases the number of CEF processes and disables shared memory, which migh be to limited in Docker environments.

// FIX 1: Increase renderer process limit to support more concurrent HTML layers // Default CEF limit is ~3-6 processes, which limits HTML layer count command_line->AppendSwitchWithValue("renderer-process-limit", "20");

// FIX 2: Prevent shared memory exhaustion on Linux (especially in Docker) // /dev/shm is limited to 64MB by default in most Docker containers command_line->AppendSwitch("disable-dev-shm-usage");

toontoet avatar Nov 14 '25 10:11 toontoet

From reading https://github.com/puppeteer/puppeteer/issues/1834 I am not sure that the dev-shm change is a good idea.

Instead maybe it would be enough to document that when running the docker image --shm-size=256m argument should be used. Perhaps some testing is needed to choose a suitable value for that, or leave that up to the user.

Julusian avatar Nov 14 '25 11:11 Julusian