Skip to content

joshmsmith/temporal-ratelimit-tester-go

Repository files navigation

Rate Limit Tester

Sample golang app with workers and clients to generate load.

Temporal Cloud Connection

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

Sample usage

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.

Quick Start (Recommended)

Use the included scripts to easily start/stop multiple instances:

  1. Start processes interactively - The script will prompt you for how many of each type to start:
./start-multiple.sh

The 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
  1. View running processes:
./list-processes.sh
  1. Stop all processes:
./stop-all.sh

Logs for each instance are saved in the ./logs/ directory.

Manual Start (Alternative)

  1. Start workers
go run accumulator/worker/main.go

I recommend starting several, I went with 6.

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

  1. Start Querier
go run accumulator/query/main.go

I recommend 2.

  1. Monitor your namespace's metrics, observe rate limiting.

About

Tools to test rate limits in Temporal Service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors