Cost Control and Resource Isolation

Topics Covered

Where the Money Actually Goes

The decomposition that is worth having

The difference between the largest line and the growing line

Cost per query is the wrong unit

What a workload class actually is

What a cost dashboard has to show to be useful

The cost of being ready

Why the metadata line grew

A data platform bill is one number on an invoice and about nine different decisions underneath it, and the gap between those two things is where most cost programmes fail. Somebody is asked to reduce spend, they look at the invoice, they see that compute is the largest line, and they go looking for expensive queries. Six weeks later the expensive queries are slightly cheaper, the bill is the same, and nobody can explain why.

The reason is almost always that the largest line on the invoice is not the line that is growing, and the line that is growing is not the line anybody is looking at. Cost control starts with a decomposition honest enough that you can point at a number and name the decision that produced it.

The decomposition that is worth having

This platform spends one hundred and eighty four thousand dollars a month. Compute is one hundred and seven thousand of that, object storage is thirty four thousand nine hundred, egress and cross region traffic is twenty thousand two hundred, catalog and metadata API calls are twelve thousand nine hundred, and everything else, meaning logging, monitoring and the orchestrator itself, is nine thousand.

That decomposition already contains one surprise. Metadata API calls cost twelve thousand nine hundred dollars a month, which is more than the orchestrator, the logging pipeline and the monitoring stack put together. Nobody had ever looked at that number, because it does not appear as a line item on any team's dashboard. It appears as object storage request charges, buried inside a line most people read as storage.

The difference between the largest line and the growing line

Eight months ago this bill was one hundred and twenty thousand dollars. Compute went from seventy one thousand to one hundred and seven thousand over those eight months, which is an increase of thirty six thousand. Storage went from twenty six thousand to thirty four thousand nine hundred, an increase of under nine thousand. Everything else went from twenty three thousand to forty two thousand one hundred, an increase of nineteen thousand.

Compute is the largest line and it is growing. That much is unsurprising. What is surprising is that the third bucket, the one made of egress, metadata calls and platform overhead, grew by nineteen thousand dollars, which is more than half of what compute grew by, from a base of less than a quarter of compute's size. In proportional terms it is the fastest growing thing on the platform and nothing in the cost review had ever mentioned it.

One hundred and eighty four thousand dollars a month, decomposed four ways, with the fastest growing bucket the one nobody was reporting.

Cost per query is the wrong unit

The instinctive next step is to rank queries by cost and start at the top. It is a reasonable instinct and it is usually a dead end, for a structural reason worth internalising.

A query's cost is dominated by what it reads, and what it reads is determined by the layout of the table, which was decided by a different team at a different time. The expensive query is frequently a cheap query running against a badly laid out table. Optimising the query produces a ten percent improvement. Fixing the layout produces a ninety percent improvement for every query against that table, including the forty you never looked at.

The right unit of analysis is therefore not the query. It is the workload class, because a workload class is something you can make a decision about.

What a workload class actually is

On this platform the one hundred and eighty four thousand dollars divides into five classes. Scheduled batch is sixty one thousand four hundred, interactive dashboards are thirty eight thousand nine hundred, streaming jobs are thirty one thousand two hundred, backfills and reprocessing are twenty seven thousand eight hundred, and ad hoc exploration is twenty four thousand seven hundred.

Each of those is a different conversation. Scheduled batch runs whether or not anyone reads the output, so the question is which of those outputs anyone reads. Interactive dashboards cost what they cost because nine of them refresh every five minutes, so the question is whether anyone looks at a dashboard more than once an hour. Backfills are twenty seven thousand eight hundred dollars that came from two specific projects, so that number goes to zero on its own and reporting it as a trend is misleading.

Ad hoc exploration is the smallest class and generates the most complaints, which is a pattern you will see repeatedly. It is twenty four thousand seven hundred dollars and it is the only class where a human is sitting there waiting, so it is the only class anyone experiences.

Level Expectations

What a cost dashboard has to show to be useful

Most platform cost dashboards show a total and a trend, and a total with a trend is almost useless, because it tells you that something changed without telling you what decision to revisit.

A dashboard that produces action needs three things the invoice does not provide. It needs the decomposition by workload class rather than by billing line, because a billing line is the vendor's taxonomy and a workload class is yours. It needs each number attached to the knob that moves it, so that the dashboard line for interactive dashboards sits next to the refresh interval that produced it. And it needs a denominator, because thirty eight thousand nine hundred dollars of dashboard spend means something different when it serves nine dashboards than when it serves four hundred.

The denominator is the part people skip and it is the part that prevents the worst mistakes. Cost per dashboard, cost per scheduled job, cost per terabyte delivered to a consumer and cost per interactive query are four numbers that let you tell an expanding platform from a degrading one. Without them a bill that grows because the company grew looks identical to a bill that grows because a table lost its layout, and those two require opposite responses.

The cost of being ready

One line in the compute number deserves separate treatment. Nineteen thousand dollars a month on this platform buys a warm pool, meaning capacity that is running and idle so that an interactive query starts in about four seconds instead of about ninety.

Averaged across the month that pool runs at thirty one percent utilisation. Phrased as a cost efficiency number, thirty one percent sounds indefensible, and a cost programme that reports utilisation without context will propose cutting it. Phrased as what it buys, it is the difference between an analyst getting an answer in four seconds and getting it in a minute and a half, repeated across every interactive query on the platform.

Neither phrasing is wrong. The mistake is believing that this is a platform decision. It is not. It is a product decision about how responsive the platform should feel, and the platform team's job is to put both numbers in front of whoever owns that decision rather than deciding unilaterally in either direction.

Why the metadata line grew

The twelve thousand nine hundred dollar metadata line has a specific cause that is worth tracing, because it generalises.

Object storage charges per request, not only per byte. A listing operation is a request. Opening a file is a request. Reading a footer is a request. A query that touches five hundred thousand small files makes well over a million requests before it reads a useful byte, and at the published rate per thousand requests that is real money.

The metadata line is therefore not a metadata problem. It is the small file problem, appearing on the invoice under a different name. That is the single most common shape in platform cost work. The line item that grows is rarely the thing that is wrong, and tracing it back to the decision that caused it is the whole job.