This guide describes how to setup and run a load-test using a Terraform deployment.
Following this process it is possible to create a complete load-test system in a mostly automated form.
This is the recommended way to load-test a Mattermost instance for production.
- Terraform. Version 0.12 is required.
- AWS credentials to be used as described here
- A Mattermost E20 license, required to run the load-test through the
coordinator
Note
If authenticating using the AWS credentials file, the profile to use is mm-loadtest
.
git clone https://github.com/mattermost/mattermost-load-test-ng
cd mattermost-load-test-ng
In order to start the deployment process, it is required to configure the deployer appropriately.
cp config/deployer.default.json config/deployer.json
Detailed documentation for the deployer's config can be found here.
For the deployer to work, a ssh-agent needs to be running and loaded with a private key.
eval $(ssh-agent -s)
ssh-add PATH_TO_KEY
PATH_TO_KEY
should be replaced with the path to the matching private key for SSHPublicKey
, as previously configured.
go run ./cmd/ltctl deployment create
This command can take several minutes to complete when creating a full deployment.
Once done, it will output information about the entire cluster. Everything will be now ready to start a new load-test.
When starting a load-test with the ltctl
command, required configuration files are automatically uploaded to the instance hosting the coordinator.
If no files are found, defaults will be used.
To configure the coordinator, config/coordinator.json
should be created and/or edited.
cp config/coordinator.default.json config/coordinator.json
Its documentation can be found here.
To configure the load-test config/config.json
, should be created and/or edited.
cp config/config.default.json config/config.json
Its documentation can be found here.
go run ./cmd/ltctl loadtest start
This will begin to run the load-test across the whole cluster of load-test agents.
go run ./cmd/ltctl loadtest stop
This will stop the currently running load-test.
When done with a deployment, it's suggested to run:
go run ./cmd/ltctl deployment destroy
This will permanently destroy all resources for the current deployment.