Mobile App Load Testing Best Practices for User Spikes
Mobile app load testing for user spikes: load, stress, spike and soak tests, k6 vs JMeter vs Locust vs Artillery, Firebase and Supabase limits, and reading p95.
Article by
Alex Dow
Resources
•
11
mins to read
Load testing a mobile app means hammering the backend APIs your app calls with simulated users until you know where it slows down and where it breaks. Script your three or four busiest user flows, run them in a staging environment against a realistic spike, and watch p95 latency and error rate. Then fix the slowest query or the tightest limit and run it again.
Key takeaways
- You load test the backend, not the phone. The app on the device is fine; the API, database and auth service behind it are what fall over.
- Run four kinds of tests: load (normal traffic), stress (beyond normal), spike (sudden surge) and soak (hours of steady traffic).
- k6, JMeter, Locust and Artillery are all solid. Pick the one whose scripting language your team already writes.
- Firebase and Supabase both have real limits that a spike will find first: Firestore hotspots, function cold starts, Postgres connection caps and auth rate limits.
- Judge results by p95 latency and error rate against targets you set before the test, not by averages.
What load testing actually tests in a mobile app
A phone is one user. It doesn't care how many other phones exist. What cares is everything they share: your API, your database, your authentication service, your file storage, your push notification sender and any third-party APIs you call.
So a mobile load test skips the app UI entirely. You record or write down the HTTP requests (or WebSocket messages) a real session makes, then replay them from thousands of virtual users at once. A session in a booking app looks like this: refresh the auth token, load the home feed, search, open a listing, create a booking and upload a photo.
The user spikes worth planning for are predictable once you look for them. A push notification sent to every user at once. A launch day or a press mention. A Monday 9am login rush for a B2B tool. A ticket drop or a limited sale. Push notifications are the sneaky one: you control the timing, and you just told everyone to open the app in the same 60 seconds. Our post on push notification strategy covers rollout pacing from the product side.
Load vs stress vs spike vs soak tests
Grafana's k6 documentation has a clean set of definitions for load test types. Here's what each one tells you about a mobile backend:
| Test | Traffic shape | The question it answers |
|---|---|---|
| Smoke | A handful of users for a minute | Does the script work, and does the system behave at minimal load? |
| Load (average load) | Your expected normal peak, held for a while | Do we meet our latency and error targets on a normal busy day? |
| Stress | Above normal, ramped up | How does the system behave when traffic exceeds the expected average? |
| Spike | From near zero to a big number in seconds, then back down | Do we survive a sudden surge, and do we recover afterward? |
| Soak | Normal load held for hours | Do memory leaks, connection leaks or growing queues show up over time? |
| Breakpoint | Load that keeps rising until something fails | Where is the ceiling, and what breaks first? |
For user spikes specifically, the spike test is the one that matters. A system that handles 2,000 users ramped over 20 minutes can still fall over when 2,000 users arrive in 30 seconds, because autoscaling, connection pools and caches haven't warmed up yet.
Plan the test before you write a script
Pick the flows
Don't test every endpoint. Pick the three or four flows that get the most traffic and the one or two that do the most work per request: login, the home screen load, search, checkout, and anything that writes to the database or calls an external API. Weight them like real usage. If 70% of sessions only browse, 70% of your virtual users should only browse.
Set targets in advance
Write the pass and fail criteria before the first run, or you'll talk yourself into whatever number comes out. A reasonable starting point: p95 latency under 500 milliseconds for reads, under one second for writes, and an error rate under 1%. Tighten those for the screens users stare at while they wait.
Estimate the spike
Work from real numbers where you can. If you'll send a push to 40,000 users and past campaigns show how many open within the first few minutes, that's your spike. If you don't have history, test at two or three times your best guess. Being wrong on the high side costs you an afternoon. Being wrong on the low side costs you launch day.
Use a staging environment, never production
Run against a staging copy with production-like data volume and the same plan or compute tier. Supabase's production checklist says the same thing: perform load testing, preferably on a staging environment. Two more reasons. First, a load test against production can take production down. Second, if your test triggers emails, SMS or push notifications, a production run sends them to real people. Stub or gate every outbound sender before the first run.
Load testing tools compared
All four of these are open source and do the job. The best one is the one your team will actually maintain.
- k6: scripts in JavaScript, run from a CLI, with built-in thresholds that make a test pass or fail. Good fit for teams already writing TypeScript and for running in CI.
- Apache JMeter: a long-standing, 100% Java application with a GUI for building test plans. Heavier to work with, but it has a huge plugin ecosystem and lots of people who know it.
- Locust: you define user behavior in plain Python code, and it supports distributed runs across multiple machines. A natural pick if your backend is Python.
- Artillery: YAML test scripts with JavaScript hooks, engines for HTTP, WebSocket and Socket.IO, a Playwright engine for browser flows, and built-in options to run distributed from AWS Lambda or Fargate.
Whichever you choose, handle auth properly. Create a pool of test accounts in staging, log them in once at the start, and reuse the tokens. Hammering your login endpoint with every virtual user on every iteration tests the wrong thing and trips auth rate limits.
Firebase specifics and limits
Firebase scales well, but it scales on its own terms, and a spike test is where you learn them.
Firestore hotspots
Firestore's best practices say to ramp up traffic gradually to new collections or lexicographically close documents, so Firestore has time to split key ranges. They also warn against monotonically increasing document IDs like Customer1, Customer2, Customer3, because sequential IDs lead to hotspots. Use auto-generated IDs.
The same page says the maximum rate you can update a single document depends on your workload, and that the best way to characterize it is load testing. In practice, the classic failure is a single counter document (likes, inventory, seats left) that every user writes to during a spike. Contention errors and latency climb fast. Distributed counters or moving the count to a background job fixes it.
Quotas and cost
Without billing enabled, Firestore's free daily quota is 50,000 document reads and 20,000 writes, resetting around midnight Pacific time (checked December 2026). A single load test can burn through that in minutes, so run tests on a billing-enabled staging project and watch the bill. The opposite risk is real too: a chatty screen that reads 200 documents per open will be expensive at scale even if it's fast. Count reads per session in your test, not just latency.
Cloud Functions cold starts
Firebase's Cloud Functions tips explain that when a function's execution environment has to be initialized from scratch, that's a cold start, and cold starts can take significant time. During a spike, new instances spin up and the first requests on each one are slow. Setting a minimum number of instances reduces cold starts, and increasing concurrency lets each instance absorb more of a spike. Both cost money, so set them for the functions on your hot path, not all of them.
Firebase also ships an Emulator Suite, which is great for functional tests but not for load tests. Emulators don't behave like production infrastructure under load, so performance numbers from them mean nothing.
Supabase specifics and limits
Connection limits
Supabase runs Postgres, and Postgres has a hard cap on connections set by your compute size. Supabase's compute and disk docs list these (checked December 2026):
| Compute | Max direct database connections | Max pooler clients |
|---|---|---|
| Nano (Free plan) | 60 | 200 |
| Micro | 60 | 200 |
| Small | 90 | 400 |
| Medium | 120 | 600 |
The mobile app itself doesn't open Postgres connections. It talks to Supabase's REST API, Auth and Realtime. But your own servers, edge functions and serverless functions do, and every serverless instance that spins up during a spike can grab a connection. The performance tuning guide names the error you'll see when they run out ("remaining connection slots are reserved for non-replication superuser connections") and recommends a connection pooler for transient workloads. If your load test shows that error, route server-side code through the pooler before you pay for bigger compute.
Auth rate limits
Supabase Auth has its own rate limits, listed in the production checklist. One catches almost everyone: without a custom SMTP provider, auth emails (signup, password recovery) default to 2 per hour. If your load test includes signups with email confirmation, it will hit that wall immediately, and so will real users on launch day. Set up custom SMTP before launch and load test signups against it in staging, with a gated mail sender that can't reach real inboxes.
Tell Supabase before a big test
The same checklist asks Team and Enterprise customers expecting high load events, such as production launches or heavy load testing, to open a support ticket with at least two weeks' notice. Put that on the calendar if your launch spike is big.
If you're still choosing a backend, our Firebase vs Supabase comparison covers how the two differ beyond load.
How to read load test results
Watch p95, not the average
The average hides your unhappiest users. If 95 requests take 100 milliseconds and 5 take 8 seconds, the average looks fine at under half a second. The p95 (the latency 95% of requests come in under) tells you the slow tail is real. Look at p99 too for checkout and login, where one slow request means a lost user.
Watch error rate
Count every non-2xx response and every timeout. A 1% error rate at peak means one in a hundred taps fails. On a spike of 10,000 sessions with six requests each, that's 600 failed requests in a few minutes.
Make it pass or fail automatically
k6's thresholds let you encode targets in the script. The docs' own example fails the run if more than 1% of HTTP requests fail or if p95 latency goes over 200 milliseconds. Wire that into CI and you'll know when a change makes things slower, before users do.
Find the knee
Plot latency against the number of virtual users. It stays flat, then bends upward sharply. That bend is your real capacity. Compare it against your expected spike. If the knee is at 1,500 concurrent users and you expect 3,000, you have work to do.
Fixing the bottlenecks you find
Bigger servers are rarely the answer. Look here first:
- Missing indexes. A query that scans a table works fine with 1,000 rows and collapses at 1,000,000. Check the slowest queries during the test and index them.
- N+1 queries. A feed screen that runs one query for the list and one more per item. Batch or join them.
- Connection exhaustion. Use a pooler, close connections, and cap the number of serverless instances that can hit the database.
- Hot documents or rows. Counters and shared state that every user writes to. Shard them or move them to a queue.
- No caching. Data that's the same for every user, like a product catalog or a config payload, should come from a CDN or cache, not the database on every app open.
- Slow third-party calls. Payment, maps or AI APIs in the request path. Add timeouts, move what you can to background jobs, and respect their limits. Our guide to API rate limits covers backoff and retries.
- Cold starts. Minimum instances on the functions in your hot path.
Fix one thing, rerun the same test, and compare. Changing five things at once means you won't know which one helped. For the wider design questions, like when to split services or add read replicas, see our post on app scalability considerations. And if your app is on a no-code platform that won't let you add indexes or control queries, no-code app scalability covers what breaks first.
Let’s Build My App builds production backends on Firebase and Supabase on flat monthly plans (see pricing), with load testing part of shipping, not an afterthought. If a launch or campaign is coming up, our free scoping tool is a quick way to map what needs to hold up.
Frequently asked questions
How many virtual users should a mobile app load test use?
Start from your expected peak concurrent sessions, not total users. Estimate how many people will be active in the busiest few minutes, such as right after a push notification, then test at two to three times that number to leave headroom.
Should I load test in production?
No. Use a staging environment with production-like data and the same plan or compute size. Production tests can take down the live app and can send real emails, texts or push notifications to real customers.
What's a good p95 latency for a mobile app API?
A practical starting target is under 500 milliseconds for reads and under one second for writes, with an error rate below 1%. Set your own targets before testing based on which screens users wait on.
What's the difference between a spike test and a stress test?
A stress test raises traffic above normal levels to see how the system handles sustained overload. A spike test jumps from low to very high traffic in seconds, then drops, to check whether the system survives a sudden surge and recovers.
Which is the best free load testing tool?
k6, JMeter, Locust and Artillery are all open source and capable. Pick k6 or Artillery if your team writes JavaScript, Locust if it writes Python, and JMeter if you want a GUI and a large plugin ecosystem.
About Let’s Build My App
Let’s Build My App is a US-based AI development agency. We design, build, and launch production-grade custom software using AI coding tools including Claude Code and OpenAI Codex, and we migrate legacy Bubble apps onto AI-coded stacks such as React, Supabase, and Firebase. Founded and run by Alex Dow. Book a free strategy call to scope your project.
You liked this article ? Share it!
Ready to turn
your idea into reality?

Got a question?
How can I get a quote?
Jump on a free strategy call with our founder, Alex. You can schedule here or reach out to us directly.
How long will it take to complete my project?
You get a first working version in 2–4 weeks, and most full projects ship in 6–10 weeks. Timeline depends on feature complexity. Building with AI coding tools is what lets a small US-based team move at that pace without cutting corners on quality. Schedule a call for an exact estimate based on your scope.
What is AI-powered app development?
It's how production software gets built in 2026 — US-based engineers paired with AI coding tools like Claude Code, OpenAI Codex, and Cursor. You get real production code (React, Next.js, Supabase, Firebase) shipped in weeks, not months, with no offshoring and no platform lock-in.
Can AI-coded apps handle complex production workloads?
Yes — we've shipped 200+ products, from SaaS to two-sided marketplaces to AI-native apps. Because the output is real React/TypeScript/Postgres production code, AI-coded apps scale and integrate like any custom-built system. No platform ceiling, no vendor lock-in.
What happens after the application is deployed?
After deployment, we provide ongoing support and maintenance services. This includes regular updates, bug fixes, and addressing any changes. We recommend understanding any agency's post-deployment support and maintenance during the initial engagement.
