AWS Measuring Agents
This document describes how to launch Measuring Agents in AWS as EC2 instances. Readers are assumed to be familiar with AWS EC2 terms used in here, in particular if launching Measuring Agents manually.
AWS based Measuring Agents can be launched in three ways:
1. Launching AWS Measuring Agents via the RealLoad Portal
Launching AWS Measuring Agents via the RealLoad portal is the easiest of the three options. You don’t need an AWS account for this, but RealLoad ‘Clouds Credits’ are required. If you run out of Cloud Credits, you can purchase new ones in the RealLoad Shop: https://shop.realload.com/
Automatic Termination after Certain Time
EC2 instances that are started using Cloud Credits are automatically terminated after a certain time (1 to 24 hours). On the one hand, this protects you from unnecessarily losing costs of Cloud Credits, but on the other hand, you can only use such launched Measuring Agents for Load Test Jobs, but not for Synthetic Monitoring Jobs.Launching an AWS Measuring Agent using Cloud Credits
Navigate in the Portal to ‘Measuring Agents & Cluster Controllers’.
Them click the AWS icon:
Click on the rocket icon of an AWS region:
Select the ‘AWS/EC2 Instance Type’ (in this example ’t3.xlarge’) and the number of hours until the instance will be terminated (in this example 3 hours). Then click on the ‘Launch Instance’ button:
You will then receive a confirmation notification that the instance has been started. Now you have to wait at least 40 seconds until the instance gets into the running state.
The Measuring Agent is now registered in the portal. You should then ‘Ping’ it to make sure it is functional. If the Ping fails, wait another minute and then try again.
Premature Termination of an Instance - Refund of Cloud Credits
In this example, the Measuring Agent (cloud instance) was started for three hours, but the load test was performed successfully after just one and a half hours. In order to save Cloud Credits, the instance can be terminated early.
To terminate an instance launched by Cloud Credits navigate to ‘Launched Cloud Instances’:
At the relevant instance, click the ‘Terminate Instance’ icon:
Click the ‘Terminate Instance’ button:
The instance will now terminate. In this example you will receive 4 out of a total of 12 cloud credits back.
Verifying the Cloud Credit Billing
Navigate to ‘Cloud Credit Statement’ to check your Cloud Credit Balance and Transactions:
2. Launching AWS Measuring Agents via the Desktop Companion App
Launching AWS Measuring Agents via the Desktop Companion App requires that you have an AWS account.
No additional costs (beyond the costs charged by AWS) apply when using our Measuring Agent images.
Note that you need the rights to log in to the AWS Console to check whether all Measuring Agent instances that are no longer needed have been terminated.
First download, install and configure the Desktop Companion. The download links are published on https://download.realload.com
Configuring the Desktop Companion
To configure the Desktop Companion for launching AWS Measuring Agents you need:
- An AWS ‘Access Key’ of an AWS User which have the permission AmazonEC2FullAccess
- A RealLoad ‘API Authentication Token’
To generate a RealLoad ‘API Authentication Token’ sign in to the RealLoad Portal and navigate to ‘My Account’ - ‘API Authentication Tokens’:
Click the ‘Add API Authentication Token’ button:
Enter as purpose ‘Desktop Companion’ and click the ‘Add API Authentication Token’ button. Then copy the shown Token Value to the clipboard or to a text editor:
Now start the Desktop Companion and configure it. Click on the File tab and then click Settings.
In the General Tab enter:
- The Agent Secret: This is something like a password that protects the launched AWS Measuring Agents from unauthorized access. You can enter any text here, but it must not be empty.
- The Portal URL: This is the URL of the Portal Server API and should always be https://portal.realload.com/RemoteUserAPI
- The Authentication Token: Enter here the RealLoad ‘API Authentication Token’.
- Set the Refresh Interval to a value that is greater than 60 seconds.
Then click the ‘Test’ button near ‘Authentication Token’:
Switch then to the AWS Tab and enter:
- The AWS Access Key ID
- The AWS Secret Access Key
- The Preferred Instance Type: We recommend that you enter t3.medium for your first attempt.
- Set the AWS EC2 Refresh Interval to a value that is greater than 60 seconds.
- Select at My AWS Regions your preferred AWS region(s): Multiple regions can be selected by CTRL-mouse-click. We recommend that you select eu-central-1 and/or us-west-1 for your first attempt.
Then click the ‘Test’ button near ‘AWS Secret Access Key’:
Finally, click the ‘OK’ button. The configuration is now complete.
Launching an AWS Measuring Agent
In the Desktop Companion, go to the AWS tab and select an AMI of type ‘MA’ (MA = Measuring Agent). Then launch the instance with a right mouse click:
A window will appear in which you can check the configuration of the instance and set the instance auto-terminate time period. You can also choose a value of zero for the auto-terminate time period, which means that the instance will continue to run until you stop it.
Important NOTE
For technical reasons, it may happen that a Measuring Agent instance was not automatically terminated.
Follow the instructions at Double-check no longer needed Instances
The instance is then launched and in the state ‘pending’:
Now wait until the instance reaches the ‘running’ state. Then register the instance in the portal with a right mouse click:
The instance is now also displayed in ‘Portal Agents Registration’:
Check in the RealLoad Portal whether the instance is running correctly by pinging the Measuring Agent at application level:
Terminating an AWS Measuring Agent
Note that this section only applies to Measuring Agent instance which have launched via the Desktop Companion.
Two steps are necessary to terminate an instance:
- Terminate the instance in AWS
- Deregister the Measuring Agent in the portal server
To terminate an instance in AWS, perform a right mouse click in the Desktop Companion - Running AWS Images in “My Regions” at the corresponding instance and select ‘Terminate’:
Listed Instances
Note that only instances running in the regions you’ve configured in the preferences window as “My regions” and tagged with the “REAL_LOAD_AGENT” tag will be listed.The instance is then in the state ‘shutting-down’. Now you can deregister the Measuring Agent in the portal server by a right mouse click:
Double-check no longer needed Instances
Because the Desktop Companion only shows Running AWS Images in “My Regions”, some instances launched in other AWS Regions may not be displayed.
Sign in to the AWS console to review Measuring Agent instances across all AWS regions. Select EC2 Global View:
In EC2 Global View click Global search and select the the tag REAL_LOAD_AGENT:
Select the operator Equals and set the value to true, then hit the return key:
If the list displayed contains one or more instances, click on the instance(s):
Memorize the instance ID and terminate the instance:
Sign in into the RealLoad Portal and delete the corresponding Measuring Agent:
3. Launching AWS Measuring Agents via the AWS Console
In EC2, first select the AWS Region where you want to launch the Measurement Agent instance.
Creating the Security Group
In order for the AMI to be reachable from the RealLoad Portal you’ll need to configure a Security Group allowing inbound TCP/IP V4 connections to port 8080 as a minimum. Optionally, you can also configure SSH access.
In the following example the security group “Real Load Agent Security Group” was created:
Launching a Measuring Agent Instance
When launching the instance click Browse more AMIs:
Then click Community AMIs, enter our (RealLoad) AWS account 775953462348 and select the Measuring Agent image:
Add the tag REAL_LOAD_AGENT = true
Select the Instance Type and set the (existing) Security Group “Real Load Agent Security Group”. Optionally you may also set a Key Pair:
Scroll down and click Advanced Details:
In Advanced Details scroll down to User Data. In order to protect access to your Measuring Agent we strongly recommend setting a non-default secret when launching the instance.
The secret can be set at launch time by providing User Data to the AMI as follows (replace “secret” with the secret of your choice):
#!/bin/sh
echo "AGENT_SECRET=secret" > /home/ec2-user/agent_secret.sh
Scroll down to the bottom of the AWS Console and click Launch Instance:
After launching the instance click on the instance ID:
Copy the Public IPv4 address of the instance to a text editor or to the clipboard:
Sign In to the RealLoad Portal and add (=register) the Measuring Agent instance:
The Agent IP Port wil always be 8080. Enter the Auth Token which you have set as AGENT_SECRET when launching the instance.
Then ping the Measuring Agent at application level:
And check the Measuring Agent Log File to verify that the Agent Secret was configured:
The Measuring Agent is now ready for operation. Don’t forget to terminate the instance when you no longer need it.
Once you have terminated the instance, you should delete the corresponding Measuring Agent in the RealLoad Portal.