Skip to content

How to run composer load testing as an example

Chao Yang edited this page Dec 12, 2019 · 10 revisions

Preparation

check out this repo

git clone https://github.com/loadflux/loadflux.git

install npm packages

npm run install

run in your local

set environment variables

the simple way is to put a .env under the repo root, you can get it from LastPass shared folder, the note is composer-load-test. Put these variables to .env under the repo root.

Change the values of these env vars if you need, for example, you want to run against different environment or change OAuth client ID etc.

run

Change COMPOSER_USERS in .env file. This variable is to control how many users you'd like to simulate. It is suggested to set it to 20, and open multiple command lines to run the below command:

DEBUG=loadflux:* ts-node examples/main.ts

NOTE: I run 100 users (set COMPOSER_USERS to 100) in my laptop, so you can have a try, just in case you can hear the sound from the fan.

run in GCP

In the ./tools folder, there are a Dockerfile and a deployment.yaml for K8s deployment. You can control how many replicas are running. The environment variables can be put in deployment.yaml in line or create a configMap. You decide it.

run in AWS

We have a Fargate cluster in AWS sandbox account. I built a docker image in dockerhub: chaoyangnz/loadflux-stuff-composer. Devops can help run it in Fargate given you provide the image and environment variables.

Metrics

Metrics and visualisation can be seen in the dashboard: https://data.loadflux.io/orgs/26b5fecda97dcd91/dashboards/04d9260254b70000

You have to login first. The user name and password can be found int LastPass shared folder, the secure note composer-load-test.