
A/B Testing CPU Requirement Formula
Learn how annual CPU hours and average active CPU capacity are estimated for server-side A/B testing.
This calculation estimates the CPU work created by a planned A/B testing program. It turns annual traffic, experiment exposure, request activity and CPU time per request into per-test and annual CPU-hour estimates for capacity planning.
- 100% Free
- No Sign-Up Required
- Private & Secure
- Mobile Friendly
Annual CPU Hours
Where:
Estimate the requests exposed to one test, multiply them by CPU time per request, convert the result to CPU hours, and multiply by the number of tests planned each year.
Variables Explained
| Variable | What It Means | Unit |
|---|---|---|
| annualVisitors - Annual visitors | Expected number of visitors to the site or application in one year. | visitors |
| requestsPerVisitor - Tested requests per visitor | Average number of requests per visitor that pass through experiment logic. | requests |
| trafficAllocation - Traffic allocated to tests | Percentage of eligible traffic included in a typical experiment. | percent |
| testDurationDays - Average test duration | Typical length of one experiment. | days |
| cpuMillisecondsPerRequest - CPU time per tested request | CPU processing time for assignment, evaluation, logging and related experiment work on one request. | milliseconds |
| testsPerYear - Tests per year | Number of comparable experiments planned during the year. | tests |
| variantCount - Variants per test | Total variants, including the control, used to estimate average requests per variant. | variants |
Step-by-Step Calculation
Estimate annual eligible requests
Multiply annual visitors by the average number of requests that could use experiment logic.
annualVisitors * requestsPerVisitor
Apply test traffic allocation
Apply the share of eligible traffic included in the experiment.
annualVisitors * requestsPerVisitor * (trafficAllocation / 100)
Estimate tested requests per experiment
Scale annual test traffic to the portion expected during one average test duration.
annualVisitors * requestsPerVisitor * (trafficAllocation / 100) * (testDurationDays / 365)
Calculate CPU seconds per experiment
Multiply tested requests by CPU milliseconds per request, then convert milliseconds to seconds.
testRequestsPerExperiment * cpuMillisecondsPerRequest / 1000
Convert CPU time to hours
Divide total CPU seconds by 3,600 to get CPU hours for one test.
cpuSecondsPerExperiment / 3600
Calculate annual CPU hours
Multiply average per-test CPU hours by the number of tests planned annually.
cpuHoursPerExperiment * testsPerYear
Estimate average active CPU cores
Spread one test's CPU seconds evenly across its running time. This is an average capacity figure, not a peak requirement.
cpuSecondsPerExperiment / (testDurationDays * 24 * 3600)
Example: Monthly server-side experimentation program
Annual eligible requests
1,200,000 × 8
9,600,000 requests
Tested requests per test
9,600,000 × 0.50 × (28 ÷ 365)
368,219 requests
Requests per variant
368,219 ÷ 2
184,110 requests per variant
CPU seconds per test
368,219 × 50 ÷ 1,000
18,410.96 CPU seconds
CPU hours per test
18,410.96 ÷ 3,600
5.11 CPU hours
Annual CPU hours
5.11 × 12
61.37 CPU hours
Average active CPU capacity
18,410.96 ÷ (28 × 24 × 3,600)
0.0076 CPU cores
Final Result
The program is estimated to use 61.37 CPU hours per year, or 5.11 CPU hours for an average test. Average active experiment processing demand is about 0.0076 CPU cores before peak-load headroom.
Assumptions
- ✓Annual visitor traffic is distributed evenly throughout the year.
- ✓Each experiment receives the stated traffic allocation for its full duration.
- ✓CPU time per request represents experiment-specific processing, such as assignment, evaluation and logging.
- ✓Each tested request is assigned to one variant, so variants divide traffic rather than multiply total requests.
- ✓The calculation measures CPU processing time only.
Limitations
- !Real traffic is usually uneven by hour, day and season, so peak CPU demand can be much higher than the average.
- !Concurrent experiments can add workload that is not represented by a single-test active-capacity estimate.
- !Database calls, network transfer, storage, queues and analytics processing are excluded unless they are included in the entered CPU time per request.
- !CPU time may change with caching, targeting rules, payload size, logging volume and application releases.
Common Mistakes to Avoid
Entering all site requests instead of only requests that execute experiment logic.
Using wall-clock request latency as CPU milliseconds per request.
Treating average active CPU cores as a complete server-sizing recommendation.
Multiplying total requests by the number of variants when each visitor is assigned to only one variant.
Using planned traffic allocation without considering whether multiple tests overlap.
Forgetting to update the CPU-per-request estimate after adding targeting, logging or feature-evaluation work.
Related Formulas
Frequently Asked Questions
How are annual CPU hours for A/B testing calculated?
The estimate calculates tested requests for one average experiment, multiplies them by CPU time per request, converts the result to CPU hours, and multiplies by tests per year.
What does CPU time per tested request include?
It can include experiment assignment, targeting, flag or variant evaluation, exposure logging and other experiment-specific processing performed on a request.
Why are variants used in this calculator?
Variants are used to show average requests per variant. They do not increase total tested requests when each request is assigned to one variant.
What is average active CPU capacity?
It is the average CPU-core demand during an active average-length test when total CPU work is spread evenly over the test duration.
Can CPU hours be lower than active infrastructure capacity?
Yes. CPU hours measure aggregate processing work, while infrastructure capacity must also accommodate peak traffic, baseline workloads, utilization targets and resilience needs.
How can I measure CPU milliseconds per request?
Use representative application profiling, tracing or infrastructure metrics to compare CPU consumption for requests with the experiment path enabled.
Ready to calculate your result?
Use the calculator to get instant results with your own inputs.