Public project · controlled load testing
Cloud Run scalability & load testing
A FastAPI load-testing project that makes concurrency, minimum instances and startup configuration measurable rather than treating “serverless” as a performance guarantee.
- Python
- FastAPI
- Cloud Run
- Docker
- k6
At a glance
- Context
- Public demonstration of a ticket-purchase HTTP workload, documented in October 2025.
- My role
- Service implementation, deployment configuration and load-testing experiments.
- Problem
- Understand how Cloud Run configuration changes response behavior under concurrent requests.
- Stack
- Python, FastAPI, Docker, Cloud Run and k6.
- Defensible outcome
- A public service, load generator and recorded test outputs for inspecting scaling behavior. No universal throughput or production guarantee.
01
Context
I built a small HTTP service to examine Cloud Run behavior under concurrent traffic. The public project uses a ticket-purchase scenario, but its purpose is a controlled scaling experiment rather than a complete ticketing product. The repository includes a FastAPI application, Docker configuration, a k6 load profile and recorded test outputs.
02
Challenge
“It scales automatically” is not enough to choose a runtime configuration. Concurrency controls how many requests an instance may handle at once; it does not prove that the application or its downstream systems can support that work. Minimum instances and startup settings introduce different latency and resource tradeoffs.
I wanted to make those choices testable with an explicit workload. A successful experiment needs more than an average response time: it needs latency distribution, error checks and enough context to understand what was actually exercised.
03
Constraints
The sample deliberately simplifies the business operation. Its purchase endpoint waits asynchronously to simulate an external call; there is no real inventory store or payment gateway. That makes the workload easier to inspect but also limits what its results can say about a production commerce system.
04
Architecture
k6 sends JSON purchase requests to a containerized FastAPI service on Cloud Run. The handler simulates I/O with a 120 ms asynchronous delay and returns a result with a request identifier. The load profile ramps traffic up, holds it and ramps it down. It defines percentile-latency and error thresholds and checks successful HTTP responses.
The delay is part of the test fixture, not an observed production latency. The repository’s thresholds are test criteria, not a promise that every configuration passes them.
Demonstration service with a simulated delay and in-memory state. This is not a production-ready ticketing architecture.
The endpoint simulates an external dependency with an asynchronous delay. It does not implement production inventory, payments or durable duplicate protection.
05
Key decisions
I focused the comparison on concurrency, minimum instances and CPU/startup configuration. The value is in relating a setting to observed behavior rather than recommending a single magic number. The same load shape and an understood application path are necessary to make comparisons useful.
In a real evaluation, I would keep the revision, resource settings, client behavior and downstream assumptions with each run. I would also separate steady-state measurements from startup behavior before attributing a result to one setting.
06
Reliability and safety
The sample keeps seen request identifiers in process memory. That illustrates duplicate detection inside one process; it is not durable idempotency across instances, restarts or concurrent execution. I would not treat it as a safe inventory or payment mechanism.
Load tests also need an agreed target and scope. For production work, I would test only an authorized environment, observe error behavior as well as speed and check the impact on dependent APIs or databases. Those dependencies often become the actual limit before the HTTP runtime does.
07
Outcome
The result is an inspectable experiment: application code, a load profile and recorded outputs that help explain scaling decisions. I do not promote a throughput figure or a latency improvement percentage here because a controlled sample is not a universal benchmark or a customer production outcome.
08
Tradeoffs / what I would watch
More concurrency can improve utilization while increasing contention. Warm instances can reduce startup exposure while consuming resources when traffic is low. I would validate the actual workload, memory use, tail latency, downstream connection limits and durable state before transferring an experiment’s settings into production.
The next step
Let’s make the systems work together.
Tell me where the process breaks, what you use today and what needs to change. We can start with an assessment.
Discuss a project