k6 Browser Module and HTTP Scenarios in One Run: Safe to Co-Locate VUs?
0 reputation · 17 Dec 2020, 04:32 UTC
Goal
I want a single k6 test run that exercises both layers of a web application: protocol-level HTTP scenarios driving backend load, and browser-module scenarios (Chromium via CDP) capturing frontend behavior, so one end-of-test summary contains both http_req_duration and the browser_web_vital_* metrics.
Constraints and uncertainty
The browser module runs each iteration in a fresh browser context and exposes an async API distinct from the synchronous http API, so the two scenario types are configured with different executors in the same script. My concern is the resource asymmetry: each browser VU carries a Chromium process, while an HTTP VU is comparatively cheap. On a shared load generator, browser VUs could saturate CPU and memory and distort the HTTP timings and web-vital metrics collected in the same run.
I am also unsure how stable the browser scenario configuration and metric names are across k6 releases, given the module's history of API changes, so any answer should note which k6 version it applies to.
Questions
- Does k6 provide any documented mechanism to isolate or cap resources between browser and HTTP scenarios within one run, or is separate execution the only reliable option?
- If co-located, are there documented signs (metric or threshold patterns) that indicate generator saturation is skewing results?
- Which k6 versions support the current browser scenario option, and where is the compatibility boundary?