From demo to production · Carousel

Little's Law: the number that predicts when your app will crash

L = λ × W. One formula that explains almost every load collapse, before it happens in production and not after.

The carousel as it was published, slide after slide. Below, the same content as text.

The problem

The demo is perfect, production crashes

You built an app in Lovable. It's fast and smooth, because you're the only users. The moment 200 people come in together, it gets stuck, and you don't understand why.

  • Alone on the app: every request is handled immediately.
  • 200 at the same time: a queue forms that you don't even see.
  • The AI that wrote the code never asked "how many will come in here together".

Most apps don't crash from a bug. They crash from load, and that's predictable in advance.

The formula

L = λ × W

One formula explains almost every load collapse. Three variables, and that's it.

  • Know two of the three? Calculate the third. That's the whole story.
L
how many requests are stuck in the system right now.
λ
how many requests arrive every second.
W
how long it takes to handle each request.

This isn't academic theory. It's the mathematics that decides how much your server will hold.

The intuition

It's really simple division

Behind the "scary" formula sits fourth-grade logic. Imagine a coffee shop:

  • An hour is six segments of 10 minutes.
  • 30 customers an hour are 5 in each segment.
  • Each one leaves after 10 minutes, and so there are always 5 inside.

You don't need a degree. You need to understand that flow times time equals quantity. That's all.

On your app

When your Supabase breaks

Now replace "coffee shop" with an API. Exactly the same formula, only now it predicts a crash.

  • Ran out of connections? Every additional request waits.
  • Waiting brings slowness, slowness brings a timeout, and a timeout brings a crash.
Pool
60 connections to the database.
W
300 milliseconds per query.
Limit
about 200 requests a second. Beyond that, a queue begins.

This isn't a guess. You calculate the breaking point before a single user comes in.

The truth about the average

Users don't arrive like a clock

The average lies. People arrive in waves. Not 30 spread nicely over the hour, but 15 in one minute.

  • Planned by the average? You planned for failure.
  • One wave is enough to fill the whole pool.
  • The crash doesn't come at average load. It comes at the peak.

Don't plan for the calm moment. Plan for the moment everyone comes in together, like the minute a sale opens.

The domino effect

A queue that formed doesn't disappear by itself

One wave creates a queue. And even if the next minute is quiet, the queue that already formed keeps loading the system.

  • Requests wait, the server is busy, and the new ones wait even longer.
  • W gets longer, L grows, and more timeouts.
  • A snowball starts. The system doesn't recover by itself.

A load collapse isn't a one-off event. It's a chain reaction.

The number nobody checks

Even below 100% there's already a queue

Utilization is what percentage of capacity is in use. Intuition says "I still have room". The mathematics says otherwise.

  • Even below 100% queues form, because of randomness.
  • The closer you get to 100%, the more the waiting time explodes.
  • The danger zone starts long before the CPU shows full.

"I still have room" is the illusion that brings apps down.

Before launch

You don't need users to know

You can, and must, calculate the system's behavior before a single user comes in. With measurements and basic assumptions.

  • A ticketing site? Assume 100 times more in the opening minute.
  • Know W and the pool size? You already have the breaking point.
  • Planning ahead costs an hour. A crash in production costs customers.

An engineer doesn't wait for the crash to know it's coming. They calculate it in advance.

Simulate the wave

Break it in a test, not in production

Tools like k6, Locust or JMeter generate bots that simulate real users, including the randomness and the waves.

  • Load test: floods at an increasing rate until the system breaks.
  • Spike test: 5,000 users at once, like an opening minute.
  • In Lovable you have no access to the internal infrastructure, but you can run a load test from the outside, against the endpoints, and find the limit.

Better for the app to fall over at your place at night than at the customer's on launch day.

The defense

Two ways to survive load

When the wave arrives there are two strategies, and the choice between them is a business one, not only technical.

  • Most large systems combine them, according to a breaking point they already calculated.
Expand
more connections, more servers, autoscaling. Smooth, but costs money.
Regulate entry
rate limiting or a waiting room. Saves money, and people wait.

You don't choose whether there will be load. You choose what it will look like.

The AI built you an app that works. It didn't check when it breaks.

The breaking point can be calculated, tested and moved up. Before launch, not after.

What closes the chapter

The AI built you an app that works. It didn't check when it breaks.

Did a post meet you in your system?

Half an hour, the system open, free. You leave with your open decisions.

or on WhatsApp, if it's a single question. Nothing is stored on the site.