Muhammad Rafay
WorkBlogAboutContact

Work with me

DirectlyWhite-label for agencies

Solutions

All solutionsCloud infrastructureKubernetes & OpenShiftAI platform infrastructureEnterprise CMS hostingMigrations & go-liveDevOps, CI/CD & IaCSecurity & zero trustObservability & DRLoad testing

Markets

UAESaudi ArabiaQatar
  1. Home
  2. Work
  3. Load testing on Google Cloud

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.

  1. Write the scripts

    Locust scenarios for the Astro pages and the Strapi API.

  2. Build the test rig

    A Locust master and worker nodes, sized to generate the full load.

  3. 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.

  4. 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.

Solution architecture: distributed load testing on Google CloudA Locust master runs the test scripts and coordinates worker nodes, which generate up to 93,000 concurrent users. The test traffic goes through caching and a CDN in front of the Astro site and the Strapi API, to the Astro front end and the Strapi CMS on Cloud Run, with autoscaling, minimum instances, concurrency, CPU and memory tuned from the test results, and on to the database behind Strapi, sized for the load with its connections tuned.Load test rigGoogle CloudControlLocust masterTest scripts and scenariosCoordinates the workers, collects resultsLoadLocust workersDistributed across worker nodesUp to 93,000 concurrent usersEdgeCaching and CDNIn front of the Astro site and the Strapi APIRepeat requests kept off Cloud Run and the databaseApplicationAstro and Strapi on Cloud RunAstro front end and Strapi CMSAutoscaling, minimum instances, concurrency, CPU and memory tunedDataDatabase behind StrapiSized for the load, connections tunedTest trafficTest control

Architecture decisions and their trade-offs

  1. 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.

  2. 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.

  3. 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.

AreaOutcome
LoadThe platform held 93,000 concurrent users in the final run, after tuning
BottlenecksFound under load in the earlier runs and fixed before the final run
Cloud RunAutoscaling, minimum instances, concurrency, CPU and memory set from the test results
CachingCaching and CDN in front of the Astro site and the Strapi API, keeping repeat requests off the application
DatabaseThe database behind Strapi sized for the load, with its connections tuned
Test rigA 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.

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.