Sample golang app with workers and clients to generate load.
This example assumes that you have a Temporal Cloud namespace configured and have an API key for that namespace.
The values are passed into the demo app using environment variables, sample can be found in .env.example
It was valuable to me to decrease the limits of my namespace below the defaults, to generate rate-limiting throughput without overloading my testing machine (i7-13700H 2.40 GHz/32MB RAM) or incur unnecessary spend on infrastructure. I went with 40 APS/160 RPS.
Use the included scripts to easily start/stop multiple instances:
- Start processes interactively - The script will prompt you for how many of each type to start:
./start-multiple.shThe script will ask you how many workers, starters, and queriers you want to start. You can:
- Start each group individually (enter 0 to skip a group)
- Run the script multiple times to ramp up (e.g., start with 2 starters, then add 5 more later)
- It keeps track of existing processes and numbers new ones accordingly
- View running processes:
./list-processes.sh- Stop all processes:
./stop-all.shLogs for each instance are saved in the ./logs/ directory.
- Start workers
go run accumulator/worker/main.go
I recommend starting several, I went with 6.
- Start workflows
go run accumulator/starter/main.go
I recommend starting several, I ramped up from 2 up to 7 to get above 160 RPS.
- Start Querier
go run accumulator/query/main.go
I recommend 2.
- Monitor your namespace's metrics, observe rate limiting.