09 Run & deploy
Chrome Performance tuning
In this chapter
Chrome’s page scripts, animations and rendering can dominate total server CPU even after BrowserBox’s own overhead has been reduced. Compare settings at the intended number of concurrent sessions, using the same pages and client activity. Use BrowserBox’s existing streaming statistics overlay to check FPS and frame flow, and verify normal input and audio behavior after each change. Hardware GPU deployments should also follow Section 8.4.1.
The settings below are available from BrowserBox v20.7.0. Persistent per-session settings belong in the service user’s ~/.config/dosaygo/bbpro/user.env (Section 8.4). Each user running a separate BrowserBox instance has a separate file. Restart each affected instance after changing a Chrome launch setting.
9.1 Choose a workload profile #
Interactive browsing: keep the defaults, including
BBX_PERF_REDUCE_MOTION=false. EnableBBX_GPUonly when the deployment provides a working hardware GPU and driver; a CPU-only container does not gain a GPU from the switch.Automation and archiving: consider
BBX_PERF_REDUCE_MOTION=truewhen reduced website animations are acceptable. Measure the complete workload, including startup, navigation and retained-profile behavior. This is an optional combination of existing settings, not a separate named product mode.
These choices retain BrowserBox’s model-feature exclusions and do not change frame quality or impose a streaming cap. Quiet-page FPS describes the page’s demand: a blinking caret can produce only a few frames per second. To compare throughput, generate continuous native mouse movement on every tested viewer and compare drawn frames and CPU at the intended session count, using the same Chrome distribution/build, pages and viewport. Check input and audio alongside frame statistics.
9.2 Reduce website animations #
BBX_PERF_REDUCE_MOTION defaults to false. Set it to true to ask Chrome to report the standard prefers-reduced-motion: reduce preference to websites:
# ~/.config/dosaygo/bbpro/user.env
export BBX_PERF_REDUCE_MOTION=trueThen restart that user’s instance:
bbx restartSites that honour this preference may suppress or simplify animations, which can substantially reduce page CPU usage. Sites choose how to respond, so the result depends on the workload. This setting does not impose a streaming FPS cap, add input or audio delays, or pause media. The high-end streaming path remains available; fewer animation frames represent less page motion rather than an equivalent-output throughput improvement.
To return to the default preference, set BBX_PERF_REDUCE_MOTION=false in user.env and restart the instance.
9.3 Low-end device mode #
BBX_LOW_END_MODE remains true by default. Outside containers, it adds these Chrome launch flags:
--enable-low-end-device-mode
--disable-dev-shm-usageSetting it to false removes both flags; on Linux this also allows Chrome’s normal shared-memory behavior. It is separate from the reduced-motion preference and does not enable hardware GPU acceleration.
In a 30-session DuckDuckGo/Wikipedia comparison, disabling these two flags did not materially reduce CPU saturation. Keep the default unless a comparison on your own workload establishes a benefit. To try the override outside containers, set BBX_LOW_END_MODE=false in user.env and restart the instance.
Container behavior. BrowserBox’s container launch profile independently includes both flags. Setting BBX_LOW_END_MODE=false alone therefore does not remove them inside a container.
Increasing a container’s private /dev/shm capacity does not remove --disable-dev-shm-usage. A distribution’s Chromium wrapper may also add that flag independently. A larger shared-memory mount is a capacity allowance, not reserved RAM or a demonstrated CPU saving; compare effective Chrome arguments before attributing a result to shared memory. Keep CPU and memory limits appropriate for the full session count.
The persistent Docker settings file is inside the deployment’s state volume. Change that file for the affected deployment and use bbx docker restart NAME. Host kernel tuning belongs to the host administrator; a container’s setting cannot enforce a host-wide memory policy. Native Linux keeps Chrome’s normal sandbox policy. BrowserBox’s container-specific sandbox flags belong to its isolated container launch profile.
9.4 Optional Linux host memory policy #
BBX_PERF_MTHP=64k requests 64 KiB anonymous multi-size transparent huge pages and disables direct compaction. It is unset by default. This is a host-wide Linux policy affecting other processes, so the host administrator should record the current settings before applying it:
cat /sys/kernel/mm/transparent_hugepage/hugepages-64kB/enabled
cat /sys/kernel/mm/transparent_hugepage/defrag
sudo env BBX_PERF_MTHP=64k browserbox --installThe kernel must expose the hugepages-64kB/enabled interface, and the administrator must be able to write it and the THP defrag control. The installer sets the 64 KiB control to always and defrag to never. Other page sizes, shared-memory policy and Chrome’s allocator are unchanged. The same environment setting is accepted by browserbox --full-install.
The kernel decides whether each allocation can use larger pages; enabling the policy does not guarantee a particular mapping or speedup. It can improve memory behavior and streaming throughput on a suitable workload, but does not by itself prevent CPU saturation.
If BBX_PERF_MTHP=64k is also configured in user.env, startup reports whether the requested policy is active. Service startup and stop never write or restore shared kernel state. An ordinary unprivileged session cannot enforce this setting; unsupported kernels and read-only containers receive informational guidance. macOS and Windows report that this host policy is not applicable because BrowserBox implements no equivalent there.
Reverting and persistence. This policy lasts until reboot or host retuning. Unsetting the variable or selecting off makes no new changes and does not undo a previously applied policy. To revert, restore the two previously selected values through the host’s administrative configuration. BrowserBox does not install a boot service or replace the administrator’s existing tuning profile.