A close-up portrait of a man with a salt-and-pepper beard wearing a white collared shirt against a textured beige background.
A close-up portrait of a man with a salt-and-pepper beard wearing a white collared shirt against a textured beige background.

Compute gets cheaper per request at scale

J
Jesse James Richard
|
Aug 30, 2026
|
14 min read
#Architecture
#AI & Agents

I price Giant Context at $25 per million tokens. Until this week I had no defensible answer to what it costs to serve a thousand customers. There is no billing export on the project, so every infrastructure figure I held was a bottom-up estimate of a system with one tenant on it, and every projection past that was multiplication.

Multiplication is the wrong operation. Four of the five cost classes on a cloud invoice are linear in something I already measure and they multiply fine. The fifth is a queueing problem with a closed-form answer, and it bends the curve down as traffic grows.

The five cost classes

Bytes stored, bytes moved, tokens generated, seconds of CPU held. Every meter on a cloud invoice counts one of those four things, and every one of them is a quantity I already record. Where the map from telemetry to dollars is linear, forecasting is arithmetic and the only uncertainty left is the volume estimate. Sorting the meters by how they behave under growth gives five groups.

ClassMetersBehaviour under growth
LinearGemini tokens, BigQuery bytes scanned, Cloud Storage, egress, Pub/SubRate times volume. Exact.
Sub-linearCloud Run instance timeUnit cost falls. Closed form.
SteppedCloud SQL, Functions Premium, API ManagementFlat, then a jump of $100 to $1,000 a month.
Cardinality-drivenCloud Monitoring chargeable time seriesFlat under traffic. A cliff when a label changes.
Not on any rate cardCold starts, retry storms, latency under loadUnforecastable. Instrument instead.

BigQuery on-demand analysis is $6.25 per tebibyte scanned with the first tebibyte each month free, Cloud Storage Standard is $0.020 per gibibyte-month, and egress out of North America is $0.12 per gigabyte after the first hundred. Rate times volume, and the only uncertainty is the volume. Free tiers are fixed grants rather than percentages, so they subtract once, which makes them enormous at one tenant and a rounding error at a hundred.

Cloud SQL does not scale smoothly. It jumps from a db-f1-micro to two vCPUs to four to a read replica to high availability, and each jump costs somewhere between $100 and $1,000 a month. The trigger is not customer count. It is connection pool exhaustion, then working set exceeding RAM, then IOPS saturation, roughly in that order. A rate card cannot say when a step fires, but it says exactly what the step costs, so instrumenting those three signals gives warning before the bill changes.

Cloud Monitoring bills $0.258 per mebibyte of chargeable metrics, and metric volume scales with services multiplied by label cardinality rather than with traffic. Ten times the requests through the same services costs nothing extra. One new label carrying a tenant ID multiplies the series count by the tenant count and produces a bill nobody modelled.

The term that is not linear

Cloud Run bills for instance time, and it bills it whenever an instance has at least one request in flight. Nothing in that rule mentions how many requests arrived. It asks how many instances were simultaneously busy, which is a different question with an exact answer.

The arrival rate, written as lambda, is requests per second. The service time, written as S, is how long one request takes end to end. Little's Law says the average number of requests inside the system at any instant is lambda multiplied by S. Call that L. Ten requests a second at 300 milliseconds each puts three requests in flight on average.

For randomly arriving traffic the number in flight is not merely averaging L, it follows a Poisson distribution with mean L, and that holds whatever the distribution of service times looks like. Real latency on these services runs from 40 milliseconds to several seconds, and the result is unaffected.

Cloud Run packs up to c requests onto one instance, where c is the concurrency setting. So an ideal packer needs N divided by c instances when N requests are in flight, rounded up, and the number billed is the average of that across the month. Because N is Poisson, that average has a closed form, and it behaves completely differently at each end of the traffic range.

Traffic regimeInstances billedEffect on the bill
Thin, with L well below cRoughly one per request in flightIdentical to concurrency 1. Packing does nothing.
Filling, with L approaching cFlattens toward one instanceThe benefit arrives gradually, not as a switch.
Heavy, with L well above cL divided by cFull benefit. The compute term divides by the concurrency setting.

What concurrency saves, by traffic level

Requests in flight on the horizontal axis. The saving is the ratio of instances a concurrency-1 service would bill to instances a concurrency-80 service bills. It cannot exceed 80.

The saving is 1.0 at the left, which means concurrency is worth nothing. Requests do not overlap at that volume, so an instance serves one at a time regardless of what the setting says, and setting concurrency to 1,000 on a service nobody uses changes nothing at all. The saving then climbs across two orders of magnitude of traffic and flattens just under 80, which is the concurrency setting. It cannot go past it.

Integrating over a day with a peak-to-mean ratio of 3, a bursty service at L near 1 costs 28 percent less than a flat one at the same average, because the quiet hours bill nothing and scale-to-zero is worth more than packing. At L near 116 the same burstiness costs 4 percent more, because peak hours need extra instances and a ceiling function is convex. Under L of about 80 the saving comes from idle time, above it from flattening the peak.

The number I borrowed

I should have done this derivation six months ago. In February I published a comparison of Google Cloud and Azure that leaned on a six-times cost difference between concurrency 20 and concurrency 1. I took that number from Google's own worked examples on its pricing page instead of deriving it.

The figures are real and still published, $13.69 against $81.72. The sentence I wrapped around them was wrong. I wrote that the only variable between the two examples was concurrency, and it is not. Google's concurrency-20 example models a 24-hour cycle with request volume moving through a bell curve over twelve hours. The concurrency-1 example models no traffic pattern at all and never states a concurrency value. It says in prose that the application processes one request at a time. Two variables differ, and I claimed one.

Doing the multiplication myself off the same rate card gives 11.6 times, not six. Google's concurrency-1 figure also sits below what its own rate card allows. Ten million requests at 400 milliseconds with one request per instance is 4,000,000 vCPU-seconds minimum, and at $0.000024 that is $96.00 on CPU before memory or requests are counted. They publish $86.49. Solving backwards implies 330 milliseconds rather than the 400 the example states.

So I quoted a weaker number and made a stronger claim about where it came from. The real figure was better than the one I borrowed, and I would have had it by doing the arithmetic I have now done, six months later, on the same rate card that was open in front of me at the time.

The curve, and a check against simulation

One service, 1 vCPU and 512 MiB, 300 millisecond average latency, concurrency 80, a diurnal traffic day. Cost divided by traffic so the two billing behaviours sit on the same axis, with free tiers excluded so the mechanics are visible rather than the grants.

Cloud Run cost per million requests

Concurrency 1 is a flat unit cost, which is what linear looks like. Packing at concurrency 80 falls to a floor of $0.50, and $0.40 of that floor is the per-request meter.

The red line is flat because linear means constant unit cost. The blue line falls by a factor of 14 across four orders of magnitude and then stops. On the compute term alone the fall is steeper still, from $6.82 to $0.10 per million requests, a factor of 68 against a concurrency ceiling of 80.

Before trusting any of that I checked the closed form against a Monte Carlo simulation, generating exponential inter-arrival times and sampling the number of requests in flight across a long horizon. Agreement is to three decimal places, which is the sampling noise floor rather than model error.

Requests in flight (L)Closed formSimulated
0.050.04880.0506
1.1570.68560.6873
11.5701.00001.0000
115.7001.99981.9998

Where packing stops helping

The blue line flattens because Cloud Run request-based billing has two meters and only one of them packs. Instance time divides by concurrency. The $0.40 per million requests does not divide by anything. At 10 billion requests a month the compute term is $981 and the request term is $3,999, so four fifths of the bill is the meter that packing cannot touch.

Cloud Run has a second billing mode for that. Instance-based billing drops the per-request charge entirely and cuts the unit rates to $0.000018 per vCPU-second and $0.000002 per GiB-second, with a larger free grant of 240,000 vCPU-seconds. The trade is that it bills the full lifetime of every instance from start to termination, so idle time between requests is now chargeable where before it was free.

Requests per monthRequest-basedInstance-basedRequest meter as share of bill
10 million$30.61$25.4710%
100 million$80.71$38.7349%
1 billion$530.21$122.9275%
10 billion$4,980.23$922.4480%

A 5.4 times saving at a billion requests, from a radio button. The right-hand column assumes instances sit idle only 25 percent longer than they are busy, and that number is not on any rate card. It is the only input here I cannot derive, because it depends on how tightly a real arrival pattern packs rather than on any published rate.

At perfect packing with no idle at all, instance-based wins from about a million requests a month. At 50 percent idle it wins from 13.5 million. At double, 58 million. At triple, 156 million. The ratio of billable instance time to busy instance time gives the crossover directly. Until that ratio is measured, request-based billing is the safe default, because it charges nothing for idle and idle is the term nobody can predict.

The same model on real numbers

Giant Context served 438,187 requests and generated 598,315 metered tokens over the last thirty days, across eleven Cloud Run services with a single db-f1-micro behind them. Those are the driver coefficients, one dogfooding tenant's worth, and every column below is that usage multiplied out with the packing model doing the compute term and the step function doing Cloud SQL.

Infrastructure cost per million requests, by customer count

Unit cost falls 4.5 times between one customer and a thousand. The spike at ten is not an error, it is the Cloud SQL step arriving before the customers who pay for it.

Unit cost falls from $34.30 to $7.50 per million requests, almost all of it landing before 300 customers, after which the curve is flat and further growth buys nothing on unit infrastructure. Then there is the spike at ten customers, where unit cost more than doubles.

That spike is the db-f1-micro giving out and a two vCPU instance arriving in its place, $11 a month becoming $135 for capacity nobody is using yet. Every provisioned step does this. Steps are the only places on the whole curve where growing makes a business less efficient, and they are exactly where a linear forecast says nothing is happening.

Share of the monthly infrastructure bill

Compute and database dominate early. Past 300 customers the bill is mostly bandwidth, which makes a CDN the highest-leverage decision on the curve.

Every hour spent on the concurrency setting is an hour spent on the blue band, which is 8 percent of the bill at ten thousand customers. Egress is 69 percent. Putting a CDN in front of the platform at 85 percent cache offload saves $1,277 a month at a thousand customers and $12,833 at ten thousand, which is more than every compute optimisation in this post combined.

The egress coefficient behind that is 45 kilobytes per response, and it is my assumption rather than a measurement. It drives the largest line item in the model, which makes it the first thing I would replace with a real number, and it takes an afternoon to measure.

What it does to the business

Infrastructure turns out to be 12 to 14 percent of revenue while the platform is small and under 3 percent by a thousand customers. The curve above decides which lever to pull and when, and it does not decide whether the business works.

The margin sits in the token price instead, and I had been reporting that as a single figure. I bill units of AI tokens at a locked $25 per million and estimated the variable cost at $1 to $3 per million. Gemini 3 Flash is $0.50 per million in and $3.00 out. Gemini 3.1 Pro is $2.00 in and $12.00 out. Output costs six times what input costs on both, and a platform that generates websites and email emits far more tokens than it reads, so the mix decides the cost and my estimate assumed the cheap end of it.

Output share of metered tokensAll Flash25% Pro50% ProAll Pro
10%97%95%92%88%
50%93%88%82%72%
75%90%83%76%62%
90%89%81%72%56%

Gross margin ranges from 56 to 97 percent across that table and I had been quoting one point inside it. Both corners describe a plausible generation workload. Two counters on a meter I already run, model identifier and input against output, collapse the range to a number, and that is a smaller piece of work than any of the modelling above.

The corrected floor moves the break-even too. Calculated rather than estimated, the infrastructure floor at current usage is $15 to $30 a month rather than the $40 to $130 I had written down, mostly because 438,187 requests sit inside Cloud Run's free grant and cost nothing at all. Break-even against that floor is 0.6 to 1.6 million tokens a month depending on model mix, against the 4.3 million I had been planning around. Roughly double last month, not seven times it.

Where the model breaks

Every figure above is a floor rather than a forecast, and four assumptions carry the weight. Service time is treated as a constant when it is a function of load, which makes the real system a fixed point rather than a formula, safe below saturation and wrong above it with no warning at the boundary. Cold starts are excluded, and they matter most in exactly the regime the platform is in now. Poisson arrivals are an idealisation, and real traffic is burstier at short timescales than Poisson allows, which makes packing worse than modelled. The Cloud SQL thresholds are my judgement rather than a derivation.

Underneath all four sits the driver data. 440,000 requests and 5 million tokens per customer per month are one dogfooding tenant's numbers rather than a customer's, and the whole projection pivots on them. Accuracy is somewhere near plus or minus 40 percent on level and considerably better than that on shape, which is the half that is worth having. Knowing that the next cost event is Cloud SQL, that it costs $124 a month, and that unit compute improves 4.5 times before it arrives is more useful than a total accurate to the dollar.

The same model has a use I did not set out to build. Giant Context already meters usage per customer and bills against it, and pointing this at one customer's telemetry rather than the aggregate answers what their next order of magnitude costs, decomposed by driver, with the step changes marked in advance. Every prospect asks a version of that question and most platforms answer it with a sales engineer's estimate. Whether it is worth building as a product surface rather than a spreadsheet I have not decided.

The coefficients that decide whether any of this holds are the ones a real customer supplies, and I do not have one of those yet.

Building something like this

I'm Jesse. I build platforms end to end, and I'm open to work. If this is the kind of engineering you need, get in touch.

Contact Jesse
Home
About
Contact
Sitemap
Privacy Policy
Terms of Service
Cookie Policy
Compute gets cheaper per request at scale | Jesse James Richard