Aditya Dutt Pandey

Measured · June to August 2026

Published · 4 min read

Our traffic grew seven times and we got faster. I don't fully trust that.

tunyt went from 69K to 485K requests a week while latency nearly halved and the error rate fell from 2.84% to 0.32%. What we measured, how to read those numbers, what we changed, and the claim I won't make.

In three months, tunyt handled seven times as many weekly requests—and the service got faster, not slower. That sounds like the kind of before-and-after chart that deserves a raised eyebrow. I had one too: traffic mix and warm caches can make numbers move for reasons you didn't cause.

Here is what we measured between June and August 2026, while traffic was still climbing:

Before After
Weekly requests 69K 485K
Latency 110 ms 59 ms
Apdex 0.55 0.89
Error rate 2.84% 0.32%
Deploy time 20+ min under 9 min

I'll show what we changed, what the numbers do tell us, and what I can't honestly credit to any single fix.

Measure first

Before we changed a line, I made the server report how it was doing. A metrics endpoint gives request duration for every route at the 50th, 95th and 99th percentile, plus how many jobs are waiting in each queue and the state of every circuit breaker.

You usually already suspect what's slow, and acting on that is how you spend a week fixing the wrong thing. The measurements decide what we fix.

Per route, in percentiles

An average across the whole API hides things. Ninety fast endpoints will hide the one that's slow for everyone who touches it, and that's usually the one people came for. So every route gets its own numbers.

Within a route I watch percentiles. The 50th is your typical user. The 95th is the unlucky one on a slow phone and bad data, who decides your app is broken and leaves. The 99th is where the strangest bugs live.

One number for "does it feel fast"

Percentiles are precise but hard to watch day to day, so we also track Apdex, a score from 0 to 1.

You pick a target time. Requests faster than it count as satisfied. Requests up to four times slower count as tolerating. Anything slower is frustrated.

Apdex = (satisfied + tolerating / 2) / total

Going from 0.55 to 0.89 means most requests moved into satisfied. It's blunt, but it's the closest single number I know to "does this feel fast?"

What we changed

Here's the list. I can't tie each number to one change.

  • Every list query has a ceiling. Pagination on endpoints, an explicit take everywhere else.
  • Loops of lookups became one query. N round trips turned into one IN query and a Map.
  • Hot reads have a cache with real invalidation. Every write path deletes what it changes.
  • Expensive reads use single-flight. One request rebuilds a missing value while the rest serve the last good copy, so a cache expiry can't stampede the database.
  • Analytics moved to rollups. Finished days come from a daily table. Only today is computed live.
  • The database has a budget. One connection limit for the whole deployment, split between the API and the workers, with capped fan-out.
  • Hot pages start on the server. Event pages fetch their data in parallel on the server and hand it to the client's cache, so the browser doesn't wait on a second round of requests.

Deploy time is a reliability number

Deploys went from 20+ minutes to under nine. Docker layer caching stopped us rebuilding unchanged dependencies. Lint and tests became parallel jobs. Model weights got baked into the base image instead of downloaded on every build.

Deploy time shapes how a team ships. When a fix takes twenty minutes to reach production, people batch changes, and big batches are harder to review, harder to roll back and more likely to break something. At nine minutes small changes are cheap again.

I don't take full credit

Some of the improvement came from the changes above. Some almost certainly came from things I didn't control: traffic patterns shifting, caches staying warmer at higher volume, effects I never measured.

If I told you the rollup table saved exactly 30 ms, I'd be making it up. Once someone catches you overclaiming one number, they stop believing the rest.

What I can say is that the system got faster and more reliable while doing about seven times the work. Every change on that list is now a written rule that the team and our agents check before shipping, so the numbers don't slide back.

By , CTO of tunyt

← All writing