Prompt pack SCALING · BEGINNER
Does my app need load balancing?
Paste this into the agent that already has your codebase open. It inspects what you actually built, finds what breaks first under a rush, and tells you honestly whether you need a load balancer yet.
By the end you can
- Get an answer based on your real code and hosting, not on the general shape of the question.
- See the actual request path through your app and which single point of failure gives way first.
- Size the traffic honestly, from evidence or from your own answers, instead of an invented number.
- Hear "you do not need a load balancer yet" when that is the truth, along with what to watch for.
- Get a phased plan with real costs, and the operational details that make it work: health checks, shared session state, uploads, background jobs, the database, and rollback.
Start here
New here? Three steps.
- Open the first prompt below — it’s marked Start here.
- Swap the bracketed bits for your app, then paste it into your agent.
- Read what it finds. Nothing goes public until you say yes.
What this is for
A server is the computer that runs your app. While you are building, you are the only person on it, so everything feels fast. Real traffic all arrives at the same server at once, and it slows down before it starts failing. A load balancer is a traffic director that sits in front of several servers and hands each request to one that is free.
Whether you need one yet is a judgement about your app, not a rule. This prompt makes your AI coding agent do the work of answering it properly: read your repository, trace where traffic actually lands, size the load from evidence, and then commit to a recommendation it has to defend.
Two things it is built to do that a casual question will not. It forces the agent to look at your actual code and hosting rather than answer from the general shape of the question, and it makes "you do not need a load balancer yet" an allowed answer. An agent that always finds a reason to add infrastructure is not advising you, it is agreeing with you.
The prompt
Paste this into the agent that already has your project open — Claude Code, Cursor, Codex, Copilot, Cline, Windsurf, Aider, whichever you use. Let it read the repository before it answers.
You are acting as a pragmatic infrastructure reviewer for this project. I am the builder. I
am not an infrastructure engineer, so explain everything in plain English and define any term
the first time you use it.
Answer one question: does this application need load balancing, and if so, when and how?
Work in the five steps below, in order. Do not skip a step. Do not start writing code.
=== STEP 1 · INSPECT WHAT ACTUALLY EXISTS ===
Read the repository before you say anything. Report what you FOUND, with file paths, and mark
anything you could not determine as UNKNOWN rather than guessing:
- Language, framework and runtime, with versions.
- How the app is served: one long-running process, several processes, serverless functions,
containers, a static site with an API behind it, something else.
- Where it is hosted or deployed to, if the repo says. Look at deployment config, Dockerfiles,
CI workflows, platform config files, infrastructure-as-code, and any README or docs.
- Every datastore, cache, queue and third-party service it depends on.
- Anything that holds state in the memory of a single process: in-memory sessions, in-memory
caches, rate-limit counters, uploaded files written to local disk, websocket or SSE
connections, background timers, cron loops, in-process job queues, singletons.
- Any startup work that is slow or that assumes it runs exactly once.
List the UNKNOWNs explicitly. They matter more than the things you found.
=== STEP 2 · TRACE THE TRAFFIC ENTRY POINT AND THE SINGLE POINTS OF FAILURE ===
- Draw the request path as a numbered list, from the user's browser or app to the response:
what receives the request FIRST, and what each hop hands it to.
- Name every point where all traffic funnels through exactly one thing: one process, one
container, one function concurrency limit, one database, one disk, one third-party account.
- For each one, say what the user experiences when it saturates: slower pages, timeouts,
dropped connections, failed writes, lost uploads, wrong data.
- Say which single point of failure would bite FIRST. Usually it is not the web server.
=== STEP 3 · ESTIMATE THE LOAD HONESTLY ===
Do NOT invent traffic numbers. Instead:
- Search the repo for real evidence: analytics config, logging, existing metrics dashboards,
rate limits already set, plan tiers in config, load tests, prior incident notes.
- If there is no evidence, say so, then ASK ME these questions and wait for my answers before
continuing: How many people use it today, at peak? What is the biggest plausible spike in
the next three months, and what would cause it? Are requests short (a page load) or long
(a file upload, an AI call, a report)? Is downtime embarrassing, expensive, or dangerous?
- Then classify the workload as one of:
(a) SIMPLE LAUNCH — low, bursty, human-paced traffic; requests finish in well under a
second; an outage is embarrassing but survivable.
(b) SUSTAINED OR LONG-RUNNING — steady concurrency, or individual requests that hold a
process for seconds or minutes (AI generation, uploads, exports, streaming, websockets).
(c) HIGH-TRAFFIC OR CRITICAL — real concurrency at peak, or money/safety on the line.
- Show the arithmetic behind the classification: concurrent requests ≈ requests per second ×
average seconds per request. State every assumption as an assumption.
=== STEP 4 · GIVE ME A RECOMMENDATION, INCLUDING "NOT YET" ===
State one clear recommendation and defend it. These are all valid answers:
- "No load balancer yet." Say this if it is true. If the platform already spreads traffic for
me, or the real bottleneck is the database, or the traffic does not justify the operational
cost, say that plainly and tell me what to do INSTEAD and what signal should change my mind.
- "Not a load balancer, fix X first." Say this if a cheaper change (an index, caching, a CDN,
moving one slow job off the request path) buys more than another server would.
- "Yes, and here is the phased path."
Then give me PHASED OPTIONS, cheapest first. For each phase: what it is in one sentence, what
it costs in money AND in ongoing operational work, what it protects against, what it does NOT
protect against, and the specific signal that means it is time to move to the next phase.
Be explicit that adding servers behind a balancer does nothing if the bottleneck is a shared
database, and say whether that is my situation.
=== STEP 5 · EXPLAIN THE RECOMMENDED IMPLEMENTATION IN PLAIN ENGLISH ===
Write it as a plan I could hand to someone else. No code yet. Cover every one of these, and
for each one say whether it applies to MY app and why:
- Health checks: what the balancer asks each server to decide it is alive, what that endpoint
must check, and why a check that always returns OK is worse than none.
- Sticky sessions and in-memory state: what breaks the moment a user's second request lands on
a different server, and how to fix it properly (move session and cache state to a shared
store) rather than pinning users to one server.
- Websockets and long-lived connections: whether my app has any, and what they need.
- File uploads and anything written to local disk: why per-server disks stop working behind a
balancer, and where those files should go instead.
- Background jobs, cron and scheduled work: what happens when the same job runs on every
server at once, and how to make it run exactly once.
- The database: connection limits and pooling as server count grows, read/write split,
whether the database becomes the new single point of failure, and how I would know.
- Caching and CDN: what should never reach my servers at all.
- Rate limiting and abuse: why a per-process counter stops working across several servers.
- Observability: the specific things I must be able to see BEFORE this matters — request rate,
latency percentiles, error rate, saturation per server — and what to alert on.
- Graceful shutdown and deploys: how a server leaves the pool without dropping live requests.
- Testing and rollback: how to verify the change under realistic concurrency, what "it worked"
looks like in numbers, and the exact steps to undo it.
=== HARD RULES ===
- Do NOT deploy, provision, scale, migrate, change any hosting or infrastructure setting, run
any destructive command, or modify production. Not now, not as a "quick check".
- Do NOT edit application code in this pass. This pass produces a written answer only.
- If you want to change anything at all, describe the change and STOP for my approval.
- Never fabricate traffic numbers, costs, benchmarks, or platform behaviour. If you are not
sure what my hosting platform does by default, say "I need to check" and tell me exactly
what to look up.
- Distinguish clearly between what you READ in my repo, what you INFERRED, and what you are
ASSUMING.
- If the honest answer is "this is fine as it is", say that, and be specific about what would
have to change for it to stop being fine.
=== OUTPUT FORMAT ===
1. Verdict in one sentence.
2. What I found (with file paths) and what is UNKNOWN.
3. The request path, and the first thing that breaks.
4. Load estimate, with assumptions labelled.
5. Phased options with costs and tradeoffs.
6. The recommended plan in plain English, covering the checklist above.
7. What to do this week, and what to leave alone. Short version
Same structure and the same guard rails, small enough to paste into a chat box, a comment or a message. Use the long version when you want the full checklist in step five.
Show the full prompt Hide the full prompt Copy works without opening
Act as a pragmatic infrastructure reviewer here. Use plain English. Does this app need load balancing, and if so when and how? 1. INSPECT. Read the repo first. Report what you found with file paths: framework, runtime, how it is served (one process, containers, serverless), where it deploys, every datastore and third-party service, and anything held in one process's memory (sessions, caches, uploads on disk, websockets, background jobs). Mark what you cannot determine UNKNOWN, never guess. 2. TRACE. List the request path from user to response. Name every point where all traffic funnels through one thing, say what a user feels when it saturates, and which breaks FIRST. Often not the web server. 3. ESTIMATE. Do not invent traffic numbers. If the repo has no evidence, ask me: peak users today, the biggest plausible spike in three months, whether requests are short or long-running, and what an outage would cost. Wait for answers. Then classify the load as simple launch, sustained/long-running, or high-traffic/critical, with the arithmetic. 4. RECOMMEND. "No load balancer yet" is a valid answer, so say it if true, plus what to do instead and what signal should change my mind. If a cheaper fix beats another server, say that. Otherwise give phased options cheapest first, each with money cost, operational cost, and what it does and does not protect against. Say plainly whether my real bottleneck is the database, because more servers will not fix that. 5. PLAN in plain English, no code yet, saying whether each applies to me and why: health checks, sticky sessions and in-memory state, websockets, file uploads, background jobs running once, not once per server, database connection limits, caching and CDN, rate limiting across servers, what to monitor and alert on, graceful shutdown, testing under load, and rollback. RULES: do not deploy, provision, scale, migrate, change infrastructure, or edit code in this pass. Describe any change and stop for approval. Never fabricate numbers, costs or platform behaviour. Separate what you READ, INFERRED and ASSUMED. If the honest answer is "this is fine", say so and say what would change that.
What a good answer looks like
Read the reply against this before you act on it. An answer that misses several of these is a generic answer wearing your project as a costume.
- It cites file paths from your repository. If there are no paths, it did not read your code.
- It lists what it could not determine as UNKNOWN. A confident answer with no unknowns is a warning sign, not a good sign.
- It names the first thing that breaks, and it is often the database rather than the web server.
- Its traffic numbers come either from evidence in the repo or from answers you gave it.
- It labels assumptions as assumptions.
- It gives costs in money and in ongoing operational work, not just money.
- It says what each phase does NOT protect against.
- It tells you what would have to change before the next phase is worth it.
- It covers in-memory state, file uploads and background jobs. These are what actually break the first time a second server appears.
- It ends with a rollback.
Three follow-ups worth sending
Ask "which of your assumptions, if wrong, would flip your recommendation?" It is the fastest way to find out whether you got reasoning or pattern-matching.
Ask "show me the evidence in my repo for the request path and the load estimate." File paths, or it did not read your code.
Ask "what is the smallest change that buys the most safety this week?" The answer is usually not a load balancer.
Common questions
What is a server, in plain English?
The computer that runs your app. In a demo you are the only person using it, so it feels fast. Under real traffic every request lands on that same computer, and there is a limit to how many it can serve at once.
What does a load balancer actually do?
It sits in front of several servers and hands each incoming request to one of them, so instead of one server taking all of a rush, four servers take about a quarter each. It is a traffic director, nothing more mysterious than that.
Will my AI set this up on its own?
It builds what you describe to it. If load balancing never comes up, you get the version that works for one person. That call is yours to make, which is exactly why this prompt exists.
What if the answer is that I do not need one?
That is a good outcome and the prompt is written to allow it. Adding servers behind a balancer does nothing if your real bottleneck is a shared database, and the operational cost is real. Take the "what should change my mind" signal and move on.
Is it safe to let my agent run this?
This pass is read-and-report only. The prompt forbids deploying, provisioning, scaling, migrating and changing infrastructure, and forbids editing code, and it requires the agent to describe any change and stop for your approval. Keep that rule when you move on to actually implementing something.
KEEP THE PROMPTS COMING
Get the free Agent Playbook + the exact prompts.
This whole playbook is free — no signup wall, ever. Drop your email and we'll send the copy-paste prompts from this page plus one plain-English AI move a week for your business. Unsubscribe in one click.
- The exact prompts to run with your agents
- New playbooks the moment they ship
- No hype, no spam — unsubscribe anytime
→ WANT IT BUILT FOR YOU?
