General
The Meter Is Running on Every Request
Serguey Asael Shinder DEV Community 周榜
3 views
The demo cost four pence.
You ran it thirty times
while building it,
glanced at the total,
and stopped thinking about it,
because four pence
is not a number anybody worries about.
Then it shipped,
and the cost stopped being yours.
It became a function
of what people do.
Somebody pastes in
a two hundred page document.
A nightly job decides
to re summarise everything,
including the things
that have not changed.
A page re asks the same question
on every keystroke,
because somebody wired it
to the wrong event.
None of that is abuse.
That is a feature working,
and the bill grows
in a place nobody is watching,
because the graph you watch
is latency.
Treat cost the way you treat latency.
Log it per request,
beside the duration,
with the user and the endpoint attached.
Then you can answer
the question that is actually coming,
which is not how much.
It is who.
Put a ceiling on one user.
Per hour, per day,
whatever suits the product.
Decide today what happens
when somebody reaches it,
because if you do not decide,
the answer is that everyone
gets a degraded service
funded by one person
who wrote a loop.
Look at what you are sending.
Most prompts are mostly boilerplate,
the same instructions
on every single call,
and half the context is there
because somebody was unsure
what mattered and included it all.
Trimming that is not tidiness.
It is the invoice.
Cache the repeats.
People ask the same question,
in almost the same words,
far more often than you expect.
And stop sending everything
to one model.
Most of the traffic is easy.
The expensive one is answering it
only because that is what
you happened to build with.
None of this is premature.
Cost is a property of the feature,
exactly like response time
and error rate,
and it is the only one
you learn about a month late,
in a summary,
from somebody who is not pleased.
The meter is running now.
Go and read it.
– Serguey Asael Shinder
Read original: https://dev.to/sergueyasaelshinder/the-meter-is-running-on-every-request-2pc2
← Previous
Building MyZubster: Turning a Marketplace Demo Into a Real Product Experience
Next →
WrongBot — an bot that's confidently wrong 100% of the time (built for National Developers Day)
Related
My verifier accepted "13 of 13" by finding the number 13 once
General
0
Dev.to (EN Zone)
Show Me the Best Article You've Read And I'll Add It To My List
General
1
DEV Community
My registry accepted a duplicate ID, and the wrong thing failed three steps later
General
2
DEV Community
OpenResearch ให้ agent วิจัยหลายทิศทางพร้อมกัน โดยไม่ต้องส่งโค้ดออกไป
General
2
DEV Community 周榜
Comments0
No comments yet — be the first