Let me tell you about Maya and Tomasz. They are invented, so no need to search for them on any freelancer directory, but the situation they walk into is one you may recognise. They are two independent DevOps contractors who share a Slack channel and, occasionally, a client. This time the client was a small online shop with a nervous owner, a tidy set of cloud functions and an invoice that had just tripled. The owner’s message read, in full: “Is this normal?”
It was not normal, but it was explainable, and the explanation is a good tour of ServerlessOps, the habit of operating function-based systems on purpose instead of by accident. I will borrow some of the technical detail from this Ops Atlas page about ServerlessOps, covering some of the technical details, since both contractors had it open in a browser tab. Grab a coffee.
Day one: read the bill like a story
Tomasz starts with the invoice because a bill is a log written by accountants. Functions are billed in two parts, a charge per request and a charge for the time and memory used. The Atlas quotes example rates for one region at the time of writing: twenty cents per million requests, plus a tiny fraction of a cent per gigabyte-second. It adds a detail that surprises newcomers: billed duration includes the time spent running initialisation code, not just the handler body.
The request count had barely moved. The duration part had exploded. That pointed away from “we got more customers” and toward “each customer’s request is taking much longer.” Maya’s first message back was simply: “What’s slow?”
The slow neighbour
The answer was a stock-lookup call to a supplier’s service, which had gone from snappy to sluggish a few days earlier. Every checkout function waited on it. Because billing follows duration, a slower neighbour is a direct line to a bigger invoice. And because functions scale out by running more copies at once, a slower call also means more copies running at the same moment.
That second effect is the one that bites. The Atlas works through a laboratory example where a downstream call gets about ten times slower, and cost and peak concurrency both rise roughly tenfold. Maya and Tomasz had not read that example before the call. By the end of day one, they had effectively reproduced it on a small scale.
Day two: the ceiling nobody had set
Tomasz opened the concurrency page and found that no function had any cap. All of them shared one regional pool, so a surge in checkout copies could have squeezed out the functions that send order emails, or the ones that update inventory. Nothing had gone wrong yet, but only because traffic had stayed modest.
They agreed on a small set of rules, adapted from the Atlas’s guidance:
- Set a cap on each function that talks to a shared or external service, sized by what that service can handle.
- Keep expected peak use under about seventy percent of any cap, leaving room for the unexpected.
- If you reserve capacity for a function, remember it comes out of the shared pool, and the pool needs to keep a healthy remainder for everything else; the Atlas gives a figure of the reserved maximum plus one hundred as the unreserved minimum.
- Create an alert for when headroom falls below roughly thirty percent.
They also set the supplier call to give up after a short, sensible wait and fall back to a cached stock figure, so that a slow supplier would produce slightly stale numbers rather than a slow checkout. The owner called that “the first sensible thing anyone has said about this.”
Day three: talking to the client, which is the real job
Anyone who freelances knows that the technical fix is perhaps half the engagement. The other half is how the client feels. Maya had learned this the hard way a couple of years earlier, and often points people toward a set of beginner questions about freelancing in DevOps, because the most common first-year mistake is going silent while you fix things.
So they wrote a short update, in plain words: what happened, what they changed, what they would watch and what it would cost next month. They did not use the word “concurrency” more than once. They did not promise that the bill would drop to its old size, since they could not know. What they promised was visibility: a one-line weekly note with cost per thousand orders, which the owner could compare against sales.
Trust with a new client is built from small, honest messages like that one. That instinct is the subject of a practical read about winning over clients who have never hired you before, and it matters more when the news is a surprise.
Day four: measuring the right thing
Cost per request is a poor yardstick because it ignores how many requests an order needs. Cost per order is better, and the Atlas generalises it as cost per million events across the whole path, including queues and storage, not just function time. In its worked example, the whole path comes to $3.75 for each million events, which is $112.58 across a month of the traffic it models. Your figures will be different; dividing by a unit the business cares about travels anywhere.
They built a tiny spreadsheet: orders per day, total function cost, cost per order, plus two columns for how many orders had to be retried and how many ended in a failure queue. It took twenty minutes. The owner now looks at it on Monday mornings with tea, which Maya considers the best outcome of the whole project.
Right-sizing, gently
One more tool made an appearance. A popular open-source utility, which the Atlas notes makes real calls to your function and therefore has no side effects only if your function is safe to call, tries different memory settings and reports the time and cost for each. Tomasz ran it on the three busiest functions in a staging copy and found that one of them was cheaper at a higher memory setting, because it finished so much faster. The saving was modest, but it was free.
Day five: the quiet insurance
The last job was dull and important. Orders could arrive twice, for example when a customer double-clicked or when a message was replayed, and the shop’s function charged the card each time it ran. Maya added a duplicate guard keyed on the order number, stored with an expiry longer than the queue’s retention, so that a replay after a long outage could not slip through. She also passed the same key to the payment provider’s own duplicate protection.
A tip she gives every client: do not trust any single layer’s claim of “exactly once”. The Atlas lists that trust as an anti-pattern. Ask instead where the duplicate would be caught if the first layer let it through.
Notice what that spreadsheet does for the relationship. A freelancer who hands over a number the client can check against their own sales is no longer asking to be trusted on faith. It also gives the next contractor, or the same one in six months, a baseline to compare against.
What they did not do
It is worth noting the restraint. They did not rebuild the shop on containers. They did not install an observability platform. They did not rewrite the code. The Atlas is explicit that some topics, like deep telemetry pipelines and company-wide spend governance, belong to other disciplines, and for a tiny shop that would have been wild overkill. They did a few small things in a sensible order, and the owner slept better.
If you freelance on the side, there is an extra lesson here. Taking on this kind of rescue job while holding a full-time role needs care about time and conflicts, a theme covered in a piece on freelancing responsibly next to a day job. Maya and Tomasz kept the engagement small precisely so it fit around other commitments.
Take-aways you can steal
- Read the invoice as a clue: requests steady, duration up means something got slower.
- Cap concurrency per function, and size the cap from the downstream system.
- Give calls to other services a short timeout and a fallback.
- Measure cost per business unit, not per request.
- Guard side effects with a key from the business, kept longer than the longest outage you can imagine.
- Communicate early and plainly, with a promise you can actually keep.
A month later the owner’s message was a single thumbs-up and a screenshot of the Monday spreadsheet. Maya forwarded it to Tomasz with the caption “normal now.” It is the best review a freelancer can get.