economics · lesson 1 of 9 · sources checked 2026-11-20
the cost of one request
This lesson gives the cost of one request as a sum of four cost terms, and the share of each term from your numbers.
status of this lesson: documented in my test systempurpose
Before you compare two providers, you must know what one request costs you. The cost per request is the sum of four cost terms, divided by the request count: proxy bytes, solver calls, compute time, and storage. No term has a fixed share, thus you calculate each term from your own rates and counts.
objectives
- Calculate the cost of one attempt and of one request from proxy bytes, solver calls, compute time, and storage.
- Calculate the share of each cost term from your own rates and counts.
- Explain why the bytes for each page have the same weight as the request count.
- Compare the price models per GB, per successful request, per IP, and per port.
new terms
- benchmark platform
- My test system. It runs browsers and tools against test pages and records the result.
- attempt
- One try of one configuration against one target, with its own browser session.
- solver service
- A service that returns a CAPTCHA answer or token, made by people or by software.
- rate card
- A table of unit prices for proxy bytes, solver calls, compute time, and storage.
- operator
- A person or team that runs automation against a target.
- payload size
- The bytes that one page load transfers through the proxy.
- challenge
- A test that a site puts in front of a visitor before it serves the content.
- target
- A site or API that an operator collects data from.
- TLS handshake
- The exchange of messages that agrees on keys and parameters before encrypted data flows.
- metered proxy
- A proxy that charges for each byte or each request.
- price per GB
- A proxy price model that charges for each gigabyte of traffic.
- exit IP
- The source address that the target sees for a proxied request.
how it works
the four cost terms
The benchmark platform, my test system, calculates the cost of one run from four terms. A run is one job of the benchmark platform. It holds one or more attempts. Each term is a count times a unit price:
- Proxy: the bytes through the proxy, times the price of one GB.
- Solver: the calls to a solver service, times the price of one call.
- Compute: the seconds of browser and host time, times the price of one second.
- Storage: the stored bytes of the run, times the price of one stored GB.
The prices come from a rate card. The cost per attempt is the run cost divided by the attempt count. In my model, the cost per request is the run cost divided by the request count.
In my model, storage adds one time for each run, and the three other terms add for each attempt.
example A run of 4 attempts sends 400 requests. A run cost of 2 USD gives 0.50 USD for each attempt and 0.005 USD for each request.
example An operator loads 1,000 pages of 2 MB each through a proxy at 4 USD for each GB. The pages transfer 2 GB, thus the proxy term is 8 USD.
a linear model
Each term is a product of a count and a price. Thus the model is linear: two times the count gives two times the cost.
The proxy term has two counts: the request count and the payload size. The two counts have the same weight in the product. Thus, for the proxy term, a lighter page is as important as fewer requests.
example Half the bytes for each page cuts the proxy term of the example above to 4 USD. Half the requests also cuts it to 4 USD.
The share of each term is not a fixed value. It changes with your rates and your counts:
- A heavy page through an expensive proxy makes the proxy term larger.
- Many challenges in each run make the solver term larger.
- A long browser session makes the compute term larger.
Thus calculate the share from your own numbers. The first code example prints the share of each term for one run. The bytes for each page are not known before you measure them. More detail is in Bytes for each page: how to measure them (not yet published).
the bytes that a proxy counts
claim of a company Decodo documents which bytes its proxy traffic counts Decodo, source 1. These bytes count:
- The request, with its headers, cookies, and body.
- Each byte from the target.
- The response headers.
- With HTTPS, the bytes of the TLS handshake through the proxy.
- A response of the target with a status other than 200.
Thus the bytes of a metered proxy can be more than the bytes of the page body. The TLS handshake and the headers add bytes to each request. Measure the bytes at the proxy, not the size of the HTML.
price models
A proxy company can use one of these price models, or a mix of them:
- price per GB: the cost follows the bytes.
- Price for each successful request: the cost follows the count of delivered pages, not the bytes.
- Price for each IP: a fixed charge for each exit IP for a period.
- Price for each port: a fixed charge for each gateway port for a period.
With a price per GB, a heavy page costs more than a light page. With a fixed charge for each IP or port, the cost for each request falls when you send more requests in the period.
Two providers can use different price models. Change each price to one unit, for example the cost of one attempt, before you compare them.
the two sides
| automation side | detection side |
|---|---|
| The share of the proxy term comes from your own rates and counts, not from a fixed rule. If you stop the load of images, media, and fonts, the bytes fall. If you stop the load of JavaScript, the page can lose its data. | The site can raise the cost of the operator without a block: heavier pages, more scripts, and more challenges in each browser session. |
design decisions
| option | gain | cost | when it is correct |
|---|---|---|---|
| Price per GB | You pay only for the bytes that you send and get. | A heavy page or a retry raises the cost directly. | Light pages, or a low request count |
| Price for each successful request | A failed request can have no charge. | A light page costs as much as a heavy page. | Heavy pages with many failures |
| Price for each IP or each port | The cost is fixed for the period. | An exit that you do not use still costs money. | A steady, high request count in each period |
| Stop the load of images, media, and fonts | Fewer bytes go through the proxy. | A page that must have a script or an image for its data can fail. A site can see a visitor that never loads an image or a font. | The data is in the HTML or in the API response |
diagram
four cost terms add to the cost of one run, and two divisions give the unit costs
code example
The first example calculates the cost of one run from a rate card. A provider with no rate gets the highest rate of the card, and the code prints a flag. Thus a missing rate cannot give a low figure.
All rates and counts are synthetic. No rate is a real price.
Calculate the cost of one run and the share of each cost term from a rate card. Charge a provider with no rate at the highest rate, and flag it.
import { readFileSync } from "node:fs";
// Synthetic rate card and run. No rate is a real price.
type RateCard = { proxyPerGB: Record<string, number>; perSolve: number; perComputeSecond: number; perStoredGB: number };
type Attempt = { provider: string; proxyBytes: number; solves: number; computeSeconds: number };
type Run = { storedBytes: number; attempts: Attempt[] };
const GB = 1e9;
// Argument 1: the rate card (JSON). Argument 2: the counts of one run (JSON).
const card: RateCard = JSON.parse(readFileSync(process.argv[2], "utf8"));
const run: Run = JSON.parse(readFileSync(process.argv[3], "utf8"));
// A provider with no rate gets the highest rate of the card, and a flag.
const highest = Math.max(...Object.values(card.proxyPerGB));
const unpriced = new Set<string>();
const cost = { proxy: 0, solver: 0, compute: 0, storage: 0 };
for (const a of run.attempts) {
let perGB = card.proxyPerGB[a.provider];
if (perGB === undefined) {
unpriced.add(a.provider);
perGB = highest;
}
cost.proxy += (a.proxyBytes / GB) * perGB;
cost.solver += a.solves * card.perSolve;
cost.compute += a.computeSeconds * card.perComputeSecond;
}
cost.storage = (run.storedBytes / GB) * card.perStoredGB;
const total = cost.proxy + cost.solver + cost.compute + cost.storage;
for (const [term, value] of Object.entries(cost)) {
const share = (100 * value) / total;
console.log(`${term.padEnd(8)} ${value.toFixed(4)} ${share.toFixed(1)}%`);
}
console.log(`run ${total.toFixed(4)} attempts: ${run.attempts.length}`);
console.log(`attempt ${(total / run.attempts.length).toFixed(4)}`);
if (unpriced.size > 0) {
console.log(`flag: no rate, charged at the highest rate: ${[...unpriced].join(", ")}`);
}output
One line for each cost term with its cost and share, then the run cost, the cost per attempt, and the flag.
proxy 0.0480 81.5%
solver 0.0040 6.8%
compute 0.0059 10.0%
storage 0.0010 1.7%
run 0.0589 attempts: 4
attempt 0.0147
flag: no rate, charged at the highest rate: provider CI ran the code with the Node runtime and the flag --experimental-strip-types, on two synthetic files.
The rate card has no rate for provider C:
- Provider A: 4 USD for each GB.
- Provider B: 8 USD for each GB.
- One solver call: 0.002 USD.
- One compute second: 0.0001 USD.
- One stored GB: 0.02 USD.
The run stores 50,000,000 bytes. It has four attempts:
- Attempt 1: provider A, 2,000,000 proxy bytes, 0 solver calls, 12 compute seconds.
- Attempt 2: provider A, 2,000,000 proxy bytes, 1 solver call, 15 compute seconds.
- Attempt 3: provider B, 2,000,000 proxy bytes, 0 solver calls, 12 compute seconds.
- Attempt 4: provider C, 2,000,000 proxy bytes, 1 solver call, 20 compute seconds.
The second example calculates the proxy cost over a grid of request counts and payload sizes. It also gives the mean and the median of a list of page sizes. One heavy page raises the mean, but not the median.
The price and the page sizes are synthetic.
Calculate the proxy cost for each pair of request count and payload size at one price per GB. Give the median and the mean of the page sizes.
import { readFileSync } from "node:fs";
// Argument 1: a price per GB (synthetic). Argument 2: a JSON list of page sizes in bytes.
const perGB = Number(process.argv[2]);
const sizes = JSON.parse(readFileSync(process.argv[3], "utf8"));
const mean = sizes.reduce((s, x) => s + x, 0) / sizes.length;
// The median is the middle value of the sorted list, not the mean.
const sorted = [...sizes].sort((a, b) => a - b);
const mid = Math.floor(sorted.length / 2);
const median = sorted.length % 2 ? sorted[mid] : (sorted[mid - 1] + sorted[mid]) / 2;
const MB = 1e6;
const GB = 1e9;
console.log(`mean ${(mean / MB).toFixed(2)} MB, median ${(median / MB).toFixed(2)} MB`);
const counts = [1000, 10000, 100000];
const payloads = [0.5 * MB, median, 2 * MB, 5 * MB];
console.log(["MB / requests", ...counts].map((c) => String(c).padStart(14)).join(""));
for (const p of payloads) {
const cells = counts.map((n) => ((n * p) / GB) * perGB);
const row = [(p / MB).toFixed(2), ...cells.map((c) => c.toFixed(2))];
console.log(row.map((c) => c.padStart(14)).join(""));
}output
The mean and the median page size, then one row of proxy costs for each payload size.
mean 2.04 MB, median 0.90 MB
MB / requests 1000 10000 100000
0.50 2.00 20.00 200.00
0.90 3.60 36.00 360.00
2.00 8.00 80.00 800.00
5.00 20.00 200.00 2000.00The output comes from Node, the price 4, and seven page sizes: 0.4, 0.6, 0.7, 0.9, 1.2, 1.5, and 9 MB. Each cell is the request count times the payload size times the price.
data
cost of one test run by component (illustrative test rates)
status of this figure: example
- Proxy: Test run of 10 attempts 0.2
- Compute: Test run of 10 attempts 0.02
- Solver: Test run of 10 attempts 0.006
- Storage: Test run of 10 attempts 0.0009
source: Benchmark platform, code (my test system): run cost test, illustrative rates, 10 attempts; date 2026-11-16
data table
| series | item | USD |
|---|---|---|
| Proxy | Test run of 10 attempts | 0.2 |
| Compute | Test run of 10 attempts | 0.02 |
| Solver | Test run of 10 attempts | 0.006 |
| Storage | Test run of 10 attempts | 0.0009 |
The proxy term is the largest term at these rates.
total proxy cost by request count and payload size, at 8 usd for each gb
status of this figure: estimate, not measured
source: My model: proxy cost formula, at 8 USD for each GB; date 2026-11-16
data table
| series | item | USD |
|---|---|---|
| 125 000 requests | 0.5 MB | 488.28 |
| 125 000 requests | 1.0 MB | 976.56 |
| 125 000 requests | 1.5 MB | 1464.84 |
| 125 000 requests | 2.0 MB | 1953.13 |
| 125 000 requests | 2.5 MB | 2441.41 |
| 250 000 requests | 0.5 MB | 976.56 |
| 250 000 requests | 1.0 MB | 1953.13 |
| 250 000 requests | 1.5 MB | 2929.69 |
| 250 000 requests | 2.0 MB | 3906.25 |
| 250 000 requests | 2.5 MB | 4882.81 |
| 375 000 requests | 0.5 MB | 1464.84 |
| 375 000 requests | 1.0 MB | 2929.69 |
| 375 000 requests | 1.5 MB | 4394.53 |
| 375 000 requests | 2.0 MB | 5859.38 |
| 375 000 requests | 2.5 MB | 7324.22 |
| 500 000 requests | 0.5 MB | 1953.13 |
| 500 000 requests | 1.0 MB | 3906.25 |
| 500 000 requests | 1.5 MB | 5859.38 |
| 500 000 requests | 2.0 MB | 7812.5 |
| 500 000 requests | 2.5 MB | 9765.63 |
The second chart applies the proxy term to a grid of request counts and payload sizes. Two times the payload size gives the same cost as two times the request count. This is the linear model of the proxy term.
The second chart uses 1 GB = 1,024 MB, as its formula does. The code examples use 1 GB = 1,000 MB. Thus the code gives 1.024 times the chart value for the same inputs.
proxy cost of one attempt by proxy class, at 5 mb (estimates)
status of this figure: estimate, not measured
source: My model: proxy cost of one attempt at 5 MB by proxy class; date 2026-11-16
data table
| item | USD |
|---|---|
| datacenter | 0.005 |
| ISP | 0.015 |
| residential | 0.04 |
| mobile | 0.15 |
The third chart gives my estimates of the proxy cost of one attempt for each proxy class, at one payload size. Thus the price for each GB of the proxy class can change the proxy term as much as the bytes can.
failure modes
| problem | cause | correction |
|---|---|---|
| You calculate the proxy cost from the size of the HTML. | The proxy also counts the headers, the TLS handshake, and the error responses of the target. | Measure the bytes at the proxy. |
| The cost model shows a low figure for a new provider. | The rate card has no rate for that provider, and the code uses zero. | Charge a provider with no rate at the highest rate of the card, and flag it. |
| A cost column holds zero for each run. | The run did not record the bytes. | Store null until the bytes exist. Treat a zero as not recorded until a test proves it. |
| The page loses its data after you stop the load of scripts. | The page builds its content with JavaScript. | Stop only images, media, and fonts. Check the extracted data after each change. |
| You give the mean page size as the median. | A few heavy pages raise the mean. | Calculate the median from the sorted values, and give both values. |
check questions
A run has 2 attempts. Each attempt sends 1 GB through a proxy at 3 USD for each GB, and has no solver call. Compute costs 0.1 USD for each attempt, and storage costs 0.05 USD for the run. What is the cost of the run?
- 6.25 USD
- 6.20 USD
- 3.15 USD
- 6.05 USD
answer
a. 6.25 USD
The proxy term is 2 times 3 USD, the compute term is 2 times 0.1 USD, and storage adds 0.05 USD one time. The sum is 6.25 USD.
A run of 4 attempts sends 400 requests. The run cost is 2 USD. What is the cost per request?
- 0.50 USD
- 0.005 USD
- 0.02 USD
- 800 USD
answer
b. 0.005 USD
The cost per request is the run cost divided by the request count: 2 USD divided by 400 is 0.005 USD. 0.50 USD is the cost per attempt.
The proxy term of a run is 6 USD, and the total cost of the run is 8 USD. What is the share of the proxy term?
- 25%
- 75%
- 133%
answer
b. 75%
The share is the cost of the term divided by the total: 6 USD divided by 8 USD is 75%.
Explain why the payload size has the same weight as the request count in the proxy term.
sample answer
The proxy term is the request count times the payload size times the price per GB. Each term of the model is a product, so the model is linear. Half the bytes for each page cuts the proxy term by half, and half the requests also cuts it by half.
A provider charges for each successful request. Which change does not change your proxy cost?
- More successful requests
- A higher price for each request
- A lighter page with the same count of successful requests
answer
c. A lighter page with the same count of successful requests
With a price for each successful request, the cost follows the count of delivered pages, not the bytes. A lighter page costs as much as a heavy page.
exercise
exercise Do this task in your own lab, with synthetic data only. Do not send a request to a target.
- Save the first code example in an empty folder of your lab.
- Write the rate card and the run of the code example as two JSON files.
- Run the code with Node, the flag
--experimental-strip-types, and the two files. - Record the share of each cost term.
- Change the proxy bytes of each attempt to 500,000. This change stands for a stop of images, media, and fonts.
- Run the code again, and record the share of each cost term.
- Write which shares increase, and why.
sample answer
This sample answer uses the synthetic files of the code example only.
The first run gives these shares: proxy 81.5%, solver 6.8%, compute 10.0%, and storage 1.7%. The run cost is 0.0589 USD.
With 500,000 bytes for each attempt, the proxy cost falls from 0.0480 USD to 0.0120 USD. The run cost is 0.0229 USD, and the cost per attempt is 0.0057 USD. The shares are: proxy 52.4%, solver 17.5%, compute 25.8%, and storage 4.4%.
The shares of the solver, compute, and storage terms increase, but their costs do not change. Only the total is smaller. The flag for provider C stays, because the rate card still has no rate for it.
sources
- Proxy traffic, Decodo, documentation, read 2026-11-20
- Benchmark platform, code (my test system): the four cost terms of the cost of one run, 2026-11 (not public).
- My model of the price models, the proxy cost formula, the proxy cost of each proxy class, and the share of each cost term, 2026-11 (not public).