A Load Agent is a server instance that provides the simulated users in a load test. Load Testing cannot function without at least one Load Agent.
The provided files (contained in core-server.tgz) are all that you need in order to deploy a Load Agent. This tutorial will explain what changed need to be made to the files within in order to properly deploy the Load Agent.
Before starting the process, there is a step that needs to be taken for clients who received their API Fortress containers before the introduction of Load Testing.
This step is not for all users
docker-compose.yml in the main API Fortress directory. It can be located at
Paste the following code snippet in after the #RABBITMQ section and before the #APIFORTRESS DASHBOARD section:#NODEapifortress-node:image: theirish81/uitoolshostname: node.apifortressnetworks:- apifortressdomainname: node.apifortresslabels:io.rancher.container.pull_image: always
In the links section of the #APIFORTRESS DASHBOARD configuration, add the following line:- apifortress-node:node.apifortress
Save and close the
start_all.shfile in a code editor. It is also located in
Copy and paste the following and overwrite the entire contents of the file:#!/bin/bashsudo docker-compose up -d apifortress-postgressleep 5ssudo docker-compose up -d apifortress-mongosleep 5ssudo docker-compose up -d apifortress-rabbitsudo docker-compose up -d apifortress-nodesleep 30ssudo docker-compose up -d apifortresssleep 1msudo docker-compose up -d apifortress-mailersudo docker-compose up -d apifortress-schedulersudo docker-compose up -d apifortress-connector
Your API Fortress instance can now utilize the API Fortress Node Container which powers Load Testing.
Step 1 - Unzip the provided file (
First, unzip the provided file.
Users per agent are the maximum number of virtual users that each Load Agent can provide.
Large numbers of simulated users will require large amounts of hardware resources. Contact your DevOps team to develop a strategy for resource allocation.
- Locate and open the file named
application.conf. It is located in
- Line 14 of this file (
fixed-pool-size) should have it's value adjusted to match the desired number of maximum users per agent.
- Line 48 of this file (
nr-of-instances) should have it's value adjusted to match the desired number of maximum users per agent. These two values should match.
Step 3 - Configure
- Locate and open
config.yaml. It is located at
- First, we have to configure the
baseURLis located on line 3.
- If the Load Agent and the API Fortress Dashboard are located on the same server, then you can replace the baseURL with the internal address and port of the Dashboard on the server.
- If the Load Agent and the API Fortress Dashboard are located on different servers, you can replace the baseURL with the actual URL of the Dashboard. That is to say, the URL you would use to access it via web browser.
- Next, we need to provide the API Key and Secret.
- Open the main API Fortress dashboard and click the gear icon in the upper right corner to access the settings menu
- Click the "API Keys" option in the left sidebar.
- Click "+API Key"
(Click image for GIF of procedure)
- Copy the API Key to line 5 of
- Copy the Secret to line 6 of
The next step is to add the new Engine to API Fortress itself.
- Log into API Fortress as an administrator.
- Click the user icon in the upper right corner, and then click "Admin Panel"
- Click "Engines" on the left side of the screen.
- Click "+Engine"
- Enter the name and location of the Engine.
- The CRN value defaults to a random string. You must change it to something human-readable. This is the internal name of the engine.
- After modifying the CRN, copy the value to line 11 of
- Copy the secret to line 12 of
- Select the Owning Company of the Engine. An Engine must be owned by a single company. The default value (Public Engine) should not be chosen.
- Select "Yes" for "Dedicated to Load Testing"
- Click the green check to save the Engine settings.
(Click image for GIF of procedure)
At the desired server location, use the
docker-compose up -d command to deploy the Load Agent container. After the operation is complete, the Load Agent will be visible to your API Fortress Load Tests.