CDN Data Transfer or 95th-Percentile Bandwidth Billing? Compare Both Using the Same Traffic Curve
The key to choosing between CDN data transfer and 95th-percentile bandwidth billing is not simply whether traffic is high. It is how much data is transferred during a billing period and how long high bandwidth levels persist. Data transfer billing typically sums the billable bytes within the period. Under 95th-percentile bandwidth billing, measurements are sampled and sorted according to agreed rules, a portion of the highest values is discarded, and the highest remaining sample becomes the billable bandwidth. Brief bursts, recurring evening peaks, and steady delivery throughout the day can produce very different 95th-percentile bandwidth values, even with identical monthly data transfer.
Before checking any price list, verify three things: whether the curve covers the complete billing period, whether data transfer and bandwidth cover the same billing scope, and exactly how the contract defines “95” billing. Sampling intervals, rounding of discarded sample counts, billing regions, minimum charges, and spending commitments can all change the outcome. Without these conditions, dividing monthly data transfer by time to obtain average bandwidth and comparing that with a 95th-percentile quote can lead to the wrong choice.
The calculations below use explicitly defined simulated curves. They do not represent any provider's prices or measured performance. The main takeaway is: Steady loads warrant closer evaluation of 95th-percentile billing. Very high but brief spikes may also suit 95th-percentile billing, but 95th-percentile costs can jump when peak duration slightly exceeds the amount that can be discarded. The final calculation must still use actual rates and contractual rules. Workload type alone is not enough to decide.
First, Define a Consistent Basis for the Traffic Curve
Use Billable Egress Data, Not Page Views or Origin Network Interface Statistics
The best baseline for comparison is the provider's outbound byte count for each sampling window within the billing scope, or average bandwidth measurements that can be reconciled with the bill. Visits, request counts, and unique visitors are not direct substitutes: one visit might download a small page, while another might stream many video segments.
Origin egress is not a direct substitute for CDN egress to users either. On a cache hit, users still receive content from the edge; the origin may simply avoid sending the same resource again. Lower origin bandwidth therefore does not mean an equivalent reduction in billable CDN data transfer. An edge cache miss also does not necessarily send a request directly to the organization's origin: an upper-tier cache or another origin-fetching layer may sit in between.
MDN's HTTP overview explains how pages consist of multiple resource requests and how proxies can perform functions such as caching. This explains why page views, data sent by the origin, and data delivered at the edge must be measured separately. The specific product and contract still determine which bytes are billable.
Align Time Boundaries, Units, and Billing Groups
Before comparing, complete these checks:
Select a complete billing period, the billing time zone, and the actual service start and end dates. Confirm that month-end boundaries contain no omissions or double counting.
Determine whether each sample represents average bandwidth for the window, bytes transferred within the window, or the maximum value within the window. These cannot be used interchangeably.
Confirm whether the data includes all billable domains, regions, and service products. Do not combine traffic charged at different rates into one curve without accounting for those differences.
Verify unit conversions, including whether GB uses decimal units or another agreed convention, and whether bandwidth is measured in Mbps or another unit.
Record missing, delayed, and anomalous samples. Do not automatically interpret missing data as zero traffic.
This article uses decimal units throughout: 1 GB equals 10 × one hundred million bytes, and 1 Mbps equals 100 × ten thousand bits per second. The examples use a complete 30-day billing period with one average bandwidth sample every 5 minutes, excluding minimum charges, tiered rates, and additional fees. If the actual bill uses different units or rules, substitute them accordingly.
Calculate Two Billing Bases from One Curve
Data Transfer Billing: Add the Data Transferred in Every Window
Let the average bandwidth in window i be bᵢ Mbps and the window length be Δt seconds. Data transfer for that window is:
Window data transfer (GB) = bᵢ × Δt ÷ 8000.
Billing-period data transfer V is the sum across all windows. If the exported data is already in bytes, simply add the values and convert using the agreed units. There is no need to convert to bandwidth and back. If sample intervals vary, multiply each segment by its actual duration rather than taking a simple average of all values.
A purely usage-based data transfer charge can be written as: data transfer charge = V × Pᶠ, where Pᶠ is the price per GB. This is only the simplest linear model. With tiered rates, data transfer packages, or regional pricing, calculate charges separately within each applicable scope first.
“95” Billing: Select the Agreed Percentile Position After Sorting, Not 95% of Average Bandwidth
This article uses a reproducible rule: sort the N average bandwidth samples for the complete billing period from highest to lowest, discard the highest ⌊N × 5%⌋ samples, and use the highest remaining value as B₉₅. The symbols ⌊ ⌋ mean rounding down.
With 30 days and 5-minute sampling, there are 8640 samples. Discard 432 and use the highest remaining value as billable bandwidth. Those 432 windows total 36 hours, but they can be scattered throughout the month. They are not 36 consecutive hours, nor does each day receive its own “free peak period.”
A purely 95th-percentile charge can be written as: 95th-percentile charge = B₉₅ × Pᵇ, where Pᵇ is the price per Mbps per billing period. Actual contracts may specify different rounding methods, measurement scopes, valid-sample rules, or minimum billable values. The sorting algorithm here is a demonstration convention, not a universal definition for all providers.
In particular, percentile functions in general-purpose statistics software may use interpolation and return a value that never appears on the curve. If billing uses “discard samples, then take the maximum,” reproduce that discrete rule rather than calling a default percentile function.
Compare Three Reproducible Curves: Identical Data Transfer Can Produce Very Different 95th-Percentile Bandwidth
Assume a billing pool has a baseline bandwidth of 100 Mbps, rising to 1000 Mbps during events. To keep the calculation transparent, every peak falls exactly within complete 5-minute sampling windows. Bandwidth remains at the baseline at all other times, and no samples are missing.
Add a curve that stays at 150 Mbps throughout the day to compare the effect of identical data transfer with a different curve shape.
Simulated scenario | Bandwidth pattern over 30 days | Total data transfer | Average bandwidth | B₉₅ under this article's rule |
|---|---|---|---|---|
A: Short events | 100 Mbps baseline, rising to 1000 Mbps for a total of 20 hours | 40500 GB | 125 Mbps | 100 Mbps |
B: Extended events | 100 Mbps baseline, rising to 1000 Mbps for a total of 40 hours | 48600 GB | 150 Mbps | 1000 Mbps |
C: Steady delivery | Constant 150 Mbps throughout the month | 48600 GB | 150 Mbps | 150 Mbps |
A baseline of 100 Mbps over 30 days produces 32400 GB of data transfer. Scenario A adds 900 Mbps for 20 hours, contributing another 8100 GB for a total of 40500 GB. Scenario B's additional peak lasts 40 hours, adding 16200 GB for a total of 48600 GB.
Scenario A has only 240 high-value samples, fewer than the 432 that can be discarded. All 1000 Mbps samples are therefore removed, leaving B₉₅ at 100 Mbps. Scenario B has 480 high-value samples. After discarding 432, 48 remain, making B₉₅ 1000 Mbps.
This is an easily overlooked nonlinear effect of 95th-percentile billing: from A to B, total data transfer increases by 20%, but B₉₅ becomes 10 times its original value in this deliberately simplified step-shaped curve. This is a calculation based on simulated curves, not a general rate of increase or an actual provider billing example. Real curves usually contain multiple bandwidth levels, so changes may be smoother, but the mechanism is the same when the percentile position crosses into the peak range.
Scenarios B and C have exactly the same total data transfer and average bandwidth, yet their B₉₅ values are 1000 Mbps and 150 Mbps respectively. This leads to a conclusion directly relevant to plan selection: monthly data transfer totals alone are insufficient to determine whether 95th-percentile billing is economical. You need a time series that can reconstruct the sampling distribution.
Why “Only Two Peak Hours a Day” Is Not Necessarily Favorable
Two peak hours every day add up to 60 hours over 30 days, exceeding the 36 hours that can be discarded in this example. Even short individual events can leave many high-value samples in the billable range if they occur often enough.
Likewise, events across multiple workloads must be assessed after aggregation within the same billing pool. If a download site, live streaming, and software updates share one pool, peaks that seem brief individually may collectively cover a longer period. You cannot simply add event durations: overlapping events raise bandwidth at that time, while staggered events may extend the duration of high bandwidth. Both require calculation from the actual curve.
Find the Break-Even Rate Without Inventing Prices
Divide Total Data Transfer by 95th-Percentile Bandwidth to Find the Break-Even Rate Ratio
In a linear model without minimum charges or additional fees, the two charges are equal when:
V × Pᶠ = B₉₅ × Pᵇ.
The break-even rate ratio is therefore: Pᵇ ÷ Pᶠ = V ÷ B₉₅. The left-hand side has units of GB per Mbps per billing period, not a dimensionless percentage. Do not directly compare a figure quoted in “yuan/GB” with one quoted in “yuan/Mbps/month.”
The thresholds for the three simulated curves are:
Scenario | V ÷ B₉₅ | Decision under this article's linear model |
|---|---|---|
A: Short events | 405 GB/Mbps | 95th-percentile billing costs less when the actual rate ratio is below 405 |
B: Extended events | 48.6 GB/Mbps | 95th-percentile billing costs less when the actual rate ratio is below 48.6 |
C: Steady delivery | 324 GB/Mbps | 95th-percentile billing costs less when the actual rate ratio is below 324 |
This table is not a pricing recommendation. It turns a pricing question into a condition you can verify. Once you have both quotes for the same region and service scope, calculate the rate ratio to determine which base charge is lower for the current curve. At the threshold, the two base charges are equal.
The Ratio of Average Bandwidth to 95th-Percentile Bandwidth Helps Explain the Curve
Let U = average bandwidth ÷ B₉₅. For 30 days using this article's units, every 1 Mbps of average bandwidth corresponds to 324 GB of monthly data transfer, so V ÷ B₉₅ = 324 × U.
Scenario C has U of 1, while scenario B has U of 0.15, indicating that B does not fully use its 95th-percentile billable bandwidth for most of the period. Scenario A has U of 1.25. Although this exceeds 100%, it is not an error: the 95th-percentile calculation discards some high values, while monthly data transfer still includes those windows. Average bandwidth can therefore exceed B₉₅.
For this reason, U should not simply be called a “utilization rate” that can never exceed 100%. It is better treated as a comparison metric, and it must use samples from the same billing period and billing pool.
Tiers, Minimum Charges, and Data Transfer Packages Change the Simple Formula
If 95th-percentile billing has a minimum billable bandwidth, first take the greater of B₉₅ and that minimum, then apply contractual pricing. Even a smooth curve can lose its advantage in a low-traffic month because of minimum charges. Monthly spending commitments and the treatment of partial billing months must also be added separately to the model.
If a data transfer plan includes a prepaid package, compare actual cash outlays, overage charges, and unused allowances over the planning period, rather than looking only at an advertised effective unit price. An allowance that has already been purchased and cannot be refunded has different implications for this month's incremental decision and the next renewal decision. Do not treat them as the same type of cost.
When reviewing a specific product, Alibaba Cloud CDN budget differences can help structure the budget comparison between data transfer and bandwidth plans. Whether 95th-percentile billing is available, its eligibility thresholds, and its settlement rules must still be checked against the current contract or product documentation applicable to your account.
Recalculate from CSV: Establish Data Completeness Before Comparing Costs
Export Data That Reconstructs Each Sampling Window
A minimal dataset can contain just two columns: timestamp and bytes. timestamp is the window's start time, including a time zone; bytes is the outbound byte count within that window for the same billing pool. An example filename is usage.csv. Do not treat a cumulative byte counter as per-window data transfer, and do not feed rows for multiple regions into the script below before aggregating them.
If the export contains average Mbps, you can convert it using the earlier formula, but retain the original precision rather than rounding before calculation. If the console only shows hourly averages while the contract samples finer windows, the hourly curve is generally insufficient to reconstruct 95th-percentile bandwidth accurately: aggregation smooths out differences between windows.
The command below requires Python 3 and a CSV file on your local machine. It demonstrates the complete 30-day billing period for month 4 of 2025 in UTC, with one sample every 5 minutes. For actual use, replace the boundaries and interval with those specified in the contract. The script stops on missing, duplicate, misaligned, or negative-byte samples; it does not fill gaps with zeros.
python3 - usage.csv <<'PY'
import csv
import math
import sys
from datetime import datetime
start = datetime.fromisoformat("2025-04-01T00:00:00+00:00")
end = datetime.fromisoformat("2025-05-01T00:00:00+00:00")
step = 300
count = int((end - start).total_seconds()) // step
samples = {}
with open(sys.argv[1], newline="", encoding="utf-8-sig") as f:
for row in csv.DictReader(f):
t = datetime.fromisoformat(row["timestamp"].replace("Z", "+00:00"))
if t.tzinfo is None or t.utcoffset() is None:
raise ValueError("Timezone is required")
offset = (t - start).total_seconds()
value = int(row["bytes"])
if not 0 <= offset < count * step or offset % step != 0:
raise ValueError("Timestamp is outside the expected grid")
index = int(offset // step)
if index in samples or value < 0:
raise ValueError("Duplicate timestamp or negative bytes")
samples[index] = value
if len(samples) != count:
raise ValueError(f"Incomplete data: expected {count}, got {len(samples)}")
rates = sorted((v * 8 / step / 1e6 for v in samples.values()), reverse=True)
drop = math.floor(count * 0.05)
volume_gb = sum(samples.values()) / 1e9
b95 = rates[drop]
print(f"samples={count} discarded={drop}")
print(f"traffic_gb={volume_gb:.6f} b95_mbps={b95:.6f}")
if b95 > 0:
print(f"break_even_gb_per_mbps={volume_gb / b95:.6f}")
else:
print("break_even_gb_per_mbps=undefined")
PY
The samples and discarded outputs confirm the total sample count and the number discarded. traffic_gb and b95_mbps are the two billing bases, while break_even_gb_per_mbps is the rate-ratio threshold discussed above. These outputs correspond only to the statistical rules in the script and do not automatically equal the provider's final bill.
If you receive an Incomplete data message, first recover the missing intervals or confirm the contract's rules for handling valid samples. Do not fill gaps with zeros just to obtain a result. If B₉₅ is zero but data transfer is not, the workload may generate traffic in only a small number of windows. In that case, the script's linear model cannot produce a finite ratio. Check minimum billing, valid-day rules, and abnormal-traffic provisions rather than concluding that the 95th-percentile bill must be zero.
Investigate Recalculation Differences by Type
If total data transfer is close but B₉₅ differs substantially, first check sampling windows, percentile selection, aggregation order, and the billing time zone rather than questioning the rate. If both bases differ by similar proportions, check unit conversions, measurement coverage, and any adjustments to the billing basis. Do not label the entire difference “protocol overhead” without evidence.
If the 95th-percentile base matches but the amount does not, check minimum charges, regional rates, contractual discounts, taxes, and other line items. Matching data transfer with a different amount may likewise result from tiers, package allowances, or overage settlement rather than the curve itself.
Failed requests and failed business operations cannot simply be excluded from samples either. Error responses may already have sent bytes, and interrupted downloads may have transferred partial content. Billing depends on the agreement. HTTP 200 does not automatically mean the business operation succeeded, either. Cost and availability statistics should be linked, but they should not share an unexplained set of exclusion rules.
Why Regional Billing and Multi-CDN Routing Change the Result
Calculating the 95th Percentile After Aggregation Is Not the Same as Adding Separately Calculated 95th Percentiles
If the contract combines multiple regions into one billing pool, first add their bandwidth at each timestamp, then calculate the 95th percentile of the entire aggregated curve. If the contract bills each region separately, calculate each region's B₉₅ and multiply it by the corresponding rate. Do not calculate just one value for the entire site.
Group-level P95 values cannot simply be averaged, and their sum does not necessarily equal the overall P95. Whether group peaks overlap and whether each group discards the same timestamps both affect the result. If one region peaks at night and another during the day, the aggregated curve may be smoother; if they peak simultaneously, the aggregate may be higher. The actual effect can only be determined by aligning timestamps and recalculating.
This directly affects architecture choices: if the contract permits combined billing and workloads peak at different times, the combined cost may be lower than separate pools. But the outcome also depends on rates, commitments, and service scope. A single aggregated 95th-percentile value is not enough.
Multi-CDN Traffic Should Not Be Shifted in Real Time Based Only on the Lowest Unit Price
Shifting traffic from A to B may reduce A's cumulative data transfer without lowering the 95th-percentile level A has already established. Meanwhile, B may accumulate enough additional high-value windows to raise its own billable bandwidth. If both providers also have minimum charges, the combined bill may be higher after the shift.
A more reliable validation method is to simulate candidate routing rules against the same demand curve, generate a separate curve for each provider by time window, then calculate individual and total charges. The simulation should retain regional distribution, capacity constraints, and failover requirements. It should not assume that every request can be moved to the cheapest egress without impact.
Recalculating bills validates only the cost model, not delivery quality. CdnChart's provider comparison can serve as a starting point for comparing candidates, but the final decision still requires service capabilities, delivery quality, and the billing terms available to your account to be assessed together. A ranking based solely on price is not a final selection.
Which Optimizations Affect the Bill, and Which Merely Shift the Load?
A Higher Edge Cache Hit Ratio Does Not Necessarily Mean Less Edge Delivery
When a resource hits the edge cache, the user still needs to receive it. Improving the edge cache hit ratio generally helps reduce origin fetches, protect the origin, and shorten waiting time for some requests. But if the number of bytes users download stays the same, you cannot promise a proportional reduction in CDN outbound data transfer.
Browser caching, by contrast, may prevent requests from reaching the CDN again, reducing actual edge delivery. For versioned static resources, consider longer client-side cache lifetimes after verifying the update mechanism. Do not blindly extend caching for personalized pages, authenticated responses, or frequently updated content just to reduce costs.
Limit such changes to clearly defined resource paths, such as www.example.com/assets/. First verify update visibility, authorization isolation, and response headers on a small subset of resources, then expand gradually. If stale resources cannot be updated or cache boundaries are incorrect, restore the previous policy and check whether existing browser and edge caches need handling through the product's available capabilities.
Reducing Bytes and Flattening the Curve Affect Different Metrics
Compressing compressible text, removing duplicate resources, and choosing appropriate image dimensions and media bitrates directly reduce delivered bytes. Applying text-style compression again to already compressed media may provide no benefit. Savings concentrated in peak windows may also reduce B₉₅. Savings confined to low-traffic periods reduce data transfer charges but may leave 95th-percentile charges almost unchanged.
Spreading deferrable large-file downloads into off-peak periods may reduce 95th-percentile bandwidth, but the entire rescheduled curve must be recalculated. A lower peak may also become wider. If the number of high-value windows increases, the result is not necessarily cheaper. Do not concentrate transmissions to avoid billing sample points; the actual sampling method and bandwidth limits may not support that assumption.
For workloads such as update distribution, first define which tasks can be delayed and set a maximum completion deadline. Run a small-scale trial and retain the original scheduling configuration. Acceptance checks should cover not only B₉₅ but also completion times, timeouts and retries, origin load, and failover. If the trial fails, restore the original scheduling and confirm that the backlog can be cleared.
Final Decision: Validate Complete Billing Periods and Stress Scenarios Together
A single month may happen to contain no events, or events may be unusually concentrated. Budget evaluation should cover multiple complete billing periods representative of workload changes, with additional clearly defined stress scenarios: extended events, longer evening peaks, traffic takeover after a CDN failure, and launches in new regions. Scenario data must be clearly labeled as simulated and kept separate from actual bills.
Pay particular attention to the distribution of samples around the 95th-percentile cutoff. If bandwidth differs sharply above and below that position, a small number of additional peak windows can substantially change the billing base. If nearby values are similar, the result is generally less sensitive to small changes in window counts. This distribution often helps budget owners assess risk more effectively than a standalone report of “this month's 95” billable bandwidth.
Before formally switching, validate the following checklist:
Both plans use the same raw samples, with calculations performed separately for the actual billing groups.
Sample time zones, sampling intervals, missing-data handling, units, and rounding methods are all explainable.
Rates, minimum charges, tiers, spending commitments, and additional line items are included in the cost model.
At least one representative normal billing period and one workload-relevant stress scenario have been tested.
Cache or routing changes have a defined scope, rollback configurations, and business service-quality review metrics.
The effective date, permitted frequency of billing-mode changes, and treatment of partial billing periods are confirmed. Do not assume you can switch at any time.
If you currently have only monthly data transfer totals, obtain a fine-grained curve before purchasing a “95” bandwidth billing plan. If you have only a 95th-percentile value, you also need total data transfer and the contractual boundaries before comparing bills. For steady demand, focus on evaluating 95th-percentile quotes. For workloads with uncertain peak durations close to the discard threshold, pay particular attention to sudden budget increases and minimum-charge risks.
Neither data transfer nor 95th-percentile billing is a winner regardless of conditions. An actionable choice comes from combining the same curve, two clearly defined sets of rules, complete costs, and operational constraints. That lets you calculate normal months and explain why the bill changes when events run longer or traffic shifts during a failure.
- CDN billing
- CDN data transfer billing
- 95th-percentile bandwidth billing
- 95th-percentile bandwidth calculation
- CDN cost comparison
- Data transfer vs. bandwidth break-even
- Multi-CDN cost optimization