Corporate, Google Cloud
Load testing that proved a Strapi and Astro platform on Google Cloud at 93,000 concurrent users.
A corporate platform built on Astro and Strapi needed proof that it would hold very high concurrency. I designed a distributed Locust setup, wrote the test scripts, found the bottlenecks and tuned Cloud Run, caching and the database until the platform held 93,000 concurrent users.
- Client
- Corporate platform
- Delivered with
- FGS Global
- My role
- Cloud Solutions ArchitectCloud solutions, infrastructure, security and DevOps
- Stack
- Google Cloud, Cloud Run, Locust
- Duration
- 1 week
The problem
Would it hold 93,000 users at once?
An Astro front end with Strapi as the CMS ran on Cloud Run in Google Cloud. The team needed to know how much concurrent traffic it could hold, where it would break first and what to change. One load generator cannot produce 93,000 concurrent users, so the test infrastructure had to be designed as well.
What I did
- Test design. A distributed Locust setup: a master coordinating worker nodes, sized to generate 93,000 concurrent users.
- Scripting. Locust scripts for the Astro pages and the Strapi API requests behind them.
- Cloud Run. Autoscaling, minimum instances, concurrency, CPU and memory tuned from the test results.
- Caching and CDN. In front of the Astro site and the Strapi API, so repeat requests stay off the application.
- Database. The database behind Strapi sized for the load, with its connections tuned.
How delivery ran
One week, from the first script to 93,000 users.
Write the scripts
Locust scenarios for the Astro pages and the Strapi API.
Build the test rig
A Locust master and worker nodes, sized to generate the full load.
Run, find the limits, tune
Each run showed the next bottleneck. Cloud Run scaling, caching and CDN, and the database were tuned from the results.
Prove it at full load
The final run held 93,000 concurrent users on the tuned platform.
Architecture
From the edge to the data.
The test traffic is in orange. The Locust master runs the scripts and coordinates the worker nodes, which generate the concurrent users. Their requests go through caching and the CDN to the Astro site and the Strapi API on Cloud Run, and on to the database behind Strapi.
Architecture decisions and their trade-offs
Distributed Locust, master and workers
Why. One load generator cannot produce 93,000 concurrent users, so a master coordinates worker nodes that share the load and report back.
Trade-off. The test rig is infrastructure in its own right, designed and sized before the first full run.
Tune Cloud Run from measured results
Why. Autoscaling, minimum instances, concurrency, CPU and memory set from what each run showed, not from defaults.
Trade-off. Minimum instances keep capacity warm for sudden load, at the cost of paying for it when traffic is quiet.
Cache in front of the application
Why. Caching and a CDN in front of the Astro site and the Strapi API keep repeat requests off Cloud Run and the database.
Trade-off. Cached content needs clear refresh rules, so an edit in Strapi reaches visitors when expected.
What was delivered
What the week delivered.
- Locust test scripts for the Astro site and the Strapi API
- Distributed load test infrastructure: a Locust master and worker nodes
- Cloud Run scaling settings tuned from the test results
- Caching and CDN in front of the site and the API
- Database sizing and connection settings for the load
- A final run at 93,000 concurrent users on the tuned platform
Outcomes
What changed for the client.
| Area | Outcome |
|---|---|
| Load | The platform held 93,000 concurrent users in the final run, after tuning |
| Bottlenecks | Found under load in the earlier runs and fixed before the final run |
| Cloud Run | Autoscaling, minimum instances, concurrency, CPU and memory set from the test results |
| Caching | Caching and CDN in front of the Astro site and the Strapi API, keeping repeat requests off the application |
| Database | The database behind Strapi sized for the load, with its connections tuned |
| Test rig | A distributed Locust master and worker setup, sized to generate 93,000 concurrent users |
Client-identifying information and sensitive implementation details have been omitted or generalised.
More work
Similar projects
AWS Kubernetes platform modernisation
Site reliability and observability engineering
Have a cloud platform to build, modernise or improve?
Whether you are designing a new platform, modernising existing infrastructure or improving production operations, let’s discuss your requirements and delivery approach.