CPU Core Scaling Protection
BotBrowser constrains Worker thread parallelism to match the profile’s
navigator.hardwareConcurrency, keeping computation scaling consistent with the claimed core count.
Prerequisites
- BotBrowser installed. See Installation Guide.
- A profile file (
.encfor production).
Overview
navigator.hardwareConcurrency tells JavaScript how many CPU cores are available. Tracking systems can verify this value by measuring actual parallel computation speed. If a profile claims 4 cores but the host has 16, Worker-based benchmarks will complete faster than expected for a 4-core machine.
BotBrowser solves this by constraining Worker threads to match the profile’s claimed core count via CPU affinity on Linux and Windows. The computation scaling curve aligns with the reported value.
Quick Start
# Profile defines hardwareConcurrency. Workers are automatically constrained.
chromium-browser \
--bot-profile="/path/to/profile.enc" \
--user-data-dir="$(mktemp -d)"No extra flags needed. When the profile sets navigator.hardwareConcurrency, BotBrowser automatically applies CPU affinity to Worker threads.
How It Works
-
Profile sets the value. The profile defines
navigator.hardwareConcurrency(e.g., 4 cores). -
Workers are constrained. When a Worker, SharedWorker, or ServiceWorker is created, BotBrowser pins it to a subset of physical cores matching the claimed count.
-
Computation scales correctly. A parallel benchmark using 4 Workers on a “4-core” profile will show the same scaling behavior as a real 4-core machine, even if the host has more cores.
Common Scenarios
High-core server running low-core profiles
A 32-core server running a mobile profile (4 cores) will constrain all Workers to 4 physical cores:
const browser = await chromium.launch({
executablePath: process.env.BOTBROWSER_EXEC_PATH,
headless: true,
args: [
"--bot-profile=/path/to/mobile-profile.enc",
],
});
const page = await browser.newPage();
const cores = await page.evaluate(() => navigator.hardwareConcurrency);
console.log(cores); // 4 (from profile)
// Worker-based parallel benchmarks will show 4-core scaling behavior
await browser.close();Multiple profiles on same host
Each browser instance is constrained independently based on its profile. A 4-core profile and an 8-core profile on the same 32-core server show different computation scaling curves matching their respective claims.
Platform Support
| Platform | CPU Affinity | Notes |
|---|---|---|
| Linux | Supported | Uses CPU affinity to pin Worker threads |
| Windows | Supported | Uses CPU affinity to pin Worker threads |
| macOS | Not supported | macOS does not expose CPU affinity APIs. Workers run on all cores. navigator.hardwareConcurrency is still set from the profile, but parallel timing may not match. |
Troubleshooting / FAQ
| Problem | Solution |
|---|---|
hardwareConcurrency shows wrong value | Ensure your profile contains the correct core count. The value comes from the profile, not from a CLI flag. |
| Parallel benchmark still fast on macOS | macOS does not support CPU affinity. Consider running on Linux for full protection. |
| Workers seem slow | Expected when the profile claims fewer cores than the host. Workers are intentionally constrained. |
Next Steps
- Performance Optimization. Tune throughput on multi-core servers.
- Navigator Properties. Other navigator-level fingerprint surfaces.
- Stack Depth Protection. Control JavaScript recursive stack depth.
- CLI Flags Reference. Complete flag documentation.
Related documentation: Advanced Features: CPU Core Scaling | CLI Flags
Legal Disclaimer & Terms of Use • Responsible Use Guidelines . BotBrowser is for authorized fingerprint protection and privacy research only.