Skip to Content
Fingerprint ProtectionCPU Core Scaling Protection

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


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.

Choosing the reported core count

--bot-cores selects which core count navigator.hardwareConcurrency reports. The default keeps the profile’s claim.

ValueReported count
profile (default)The profile’s claimed count.
realThe host’s actual core count.
minThe lower of the profile claim and the host count.
A numberThat number exactly, as given.
# Report the profile claim (default) --bot-cores=profile # Report the host's real core count --bot-cores=real # Never claim more cores than the host actually has --bot-cores=min # Report an explicit count --bot-cores=8

Thread pools size themselves from the same resolved value, so the parallelism a page can observe stays consistent with the count it was told. An unparsable value falls back to the profile behavior rather than reporting a bogus count.


How It Works

  1. Profile sets the value. The profile defines navigator.hardwareConcurrency (e.g., 4 cores).

  2. Workers are constrained. When a Worker, SharedWorker, or ServiceWorker is created, BotBrowser pins it to a subset of physical cores matching the claimed count.

  3. 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

PlatformCPU AffinityNotes
LinuxSupportedUses CPU affinity to pin Worker threads
WindowsSupportedUses CPU affinity to pin Worker threads
macOSNot supportedmacOS 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

ProblemSolution
hardwareConcurrency shows wrong valueCheck --bot-cores first. With the default profile value the count comes from the profile, so also verify the profile contains the intended core count.
Parallel benchmark still fast on macOSmacOS does not support CPU affinity. Consider running on Linux for full protection.
Workers seem slowExpected when the profile claims fewer cores than the host. Workers are intentionally constrained.

Next Steps


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.


Related BotBrowser blog: How navigator.hardwareConcurrency Exposes Your Real CPU Core Count

Updated