Reading a query
Read a SQLAlchemy query and know, before running it, what it will ask the database and how many times.
Production performance diagnosis for Python engineers
Layer by layer, from the API down to the database.
The whole first chapter is open. No account, no card, nothing to fill in.
Written by a backend engineer: ten years of Python, five of them freelancing, at Alma, Back Market, among others.
First, find where the problem comes from. Measure, isolate, prove: you point at the cause and show the numbers behind it, instead of arguing about likely suspects.
Then, fix it, with the limits stated. No course covers every possible fix. What you get: pointers, the notions each fix rests on, and the bottlenecks that come up again and again.
Throughout, chapters that stand on their own, each recapping what it needs. Quizzes, real cases on your own stack, cheat sheets to keep.
Real data, not a mock-up
We built the classic broken endpoint: sync SQLAlchemy inside async def, plus an N+1, filled the database with 500,029 rows, and profiled it for real. Every tab is the actual output of the actual tool, and each one points at the same culprit.
Samples the call stack a few thousand times per second and shows where the time settles. Cheap enough to run on real traffic.
statistical profiler
→ Session.get holds 0.45s of a 0.52s capture: the per-row author lookup is the request.
The method
Five steps, always in that order. Skipping one is how a week disappears into the wrong layer.
Find where the time actually goes, before forming any opinion about it.
Narrow it down to one layer, one component, one call. Rule the others out with a number.
Confirm the hypothesis with a profile, a query plan or a trace. A plausible cause is not a cause.
Make the smallest change that moves the measurement, then measure again.
A real investigation
Same data returned, same machine, same code path. The only difference is that someone looked at where the time went instead of guessing.
Measured with ab -n 600 -c 10 against FastAPI + sync SQLAlchemy inside async def, PostgreSQL 17, 500,029 rows. Flip the switch.
Who it is for
Free, right now
Not a trailer, not a teaser: the entire first chapter, the same videos paying students get. You profile plain Python scripts, parallelise them, meet the GIL where it actually bites, and finish on a challenge that takes one slow script from 17 seconds to under 2. Judge the course on the real thing.
Start watching, free →No account, no card, no email. The player opens on the first lesson.
The chapters
Start with what a profiler really records, on plain scripts, then carry the same method to a running API, find the component at fault, fix it on real cases, and instrument so it never surprises you twice.
Chapter 01 Free
Before touching an API: what a profiler actually records, how to read its output on a small script, and why the first fix you reach for (threads) sometimes does nothing at all.
Chapter 02
Same method, now on a running service. Deterministic profilers record every call and slow the run down. Statistical ones sample and cost almost nothing. Knowing which to reach for, and how to read the numbers that come out, is the skill.
Chapter 03
You do not learn to diagnose by watching someone else do it. This chapter hands you broken endpoints and you fix them, one at a time, measuring before and after.
Chapter 04
The profile is clear: your code is not the problem, the database is. Now what? This is where you learn to read what the engine actually did, and to change it.
Chapter 05
Instrument once, and stop hunting. A request that crosses several services should tell you where its time went before you have to go looking for it.
Chapter 06
A load test tells you where the tail sits and what gives way first. It does not tell you what your users are living. This chapter is about that difference.
Chapter 07
The things that do not fit a chapter of their own, and the toolkit you keep after the course.
Who wrote it
Backend engineer, ten years of Python · @teva_krief
Ten years of Python, five of them freelancing: a payments company, a marketplace, a Swiss insurer, and my own SaaS products shipped end to end. Different stacks, different team sizes, the same recurring scene: an endpoint slows down, everyone has a theory, and a week goes into the wrong layer. What I teach here is what I ended up doing instead, on real production systems: measure first, isolate, prove it, and only then change the code. I build my own tooling for backend analytics and API response times, and I teach diagnosis the way I run it.
Not sure this is for you? Ten yes or no questions →
It gets less scarce every year. Plenty of people can write a FastAPI endpoint, and plenty of tools will write one for them. What almost nobody can do is take an endpoint that is slow in production, work out where the time actually goes, and prove it with a number.
For you
In an interview, in a performance review, on a freelance quote: you are not saying you know Python, you are saying you take an endpoint apart and come back with the layer, the number and the fix.
"Checkout went from 2.1 s to 140 ms. The profile showed the request sitting on send_email, so it moved to a background task. Here is the profile before, and here it is after."
For your team
The cost is not the slowdown itself: it is the three engineers investigating three different hypotheses, the infrastructure added to buy silence, and the one person every performance question ends up on. Training the team on one shared method is how that stops.
Performance problems become expensive when teams debug them without evidence.
A slow endpoint looks like a database problem. You add indexes, rewrite queries, and change the ORM. The real bottleneck was somewhere else.
The service is slow, so you scale the infrastructure. It gets better until it doesn’t. You are now paying for capacity instead of understanding the bottleneck.
Everyone has a theory about what is slow. Without the right profiling and observability skills, the team is debugging blindly.
Nothing was instrumented and nothing was written down, so the problem comes back six months later and one senior engineer is pulled off their roadmap to find it again.
Get notified
The same recorded course sits under both. One you take on your own; the other is run with your team, with the sessions and the questions that go with it. Chapter 1 is already open, free, no account needed. The rest is being recorded: leave your email and I will tell you the day it opens.
For individual engineers
Self-paced. Lifetime access, every update included.
For engineering teams
Scoped to your team size and your stack.