AWS Measuring Agents

How to launch AWS based 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. Via the RealLoad Portal
  2. Via our Desktop Companion App
  3. Via the AWS Console

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/

Launching an AWS Measuring Agent using Cloud Credits

Navigate in the Portal to ‘Measuring Agents & Cluster Controllers’. Navigate to ‘Measuring Agents & Cluster Controllers’

The click the AWS icon: click the AWS icon

Click on the rocket icon of an AWS region: Click 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: Select Instance Type and number of hours

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. Launch instance confirmation notification

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. Measuring Agent registered in the portal

Ping Measuring Agent

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’: Navigate to ‘Launched Cloud Instances’

At the relevant instance, click the ‘Terminate Instance’ icon: Click ‘Terminate Instance’ icon

Click the ‘Terminate Instance’ button: Click ‘Terminate Instance’ button

The instance will now terminate. In this example you will receive 4 out of a total of 12 cloud credits back. Refund of Cloud Credits

Verifying the Cloud Credit Billing

Navigate to ‘Cloud Credit Statement’ to check your Cloud Credit Balance and Transactions: Refund of Cloud Credits

Refund of Cloud Credits

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:

  1. An AWS ‘Access Key’ of an AWS User which have the permission AmazonEC2FullAccess
  2. 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’: Navigate to ‘My Account’ - ‘API Authentication Tokens’

Click the ‘Add API Authentication Token’ button: Click ‘Add API Authentication Token’

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: Copy the shown Token Value

Now start the Desktop Companion and configure it. Click on the File tab and then click Settings. Start and configure Desktop Companion

In the General Tab enter:

  1. 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.
  2. The Portal URL: This is the URL of the Portal Server API and should always be https://portal.realload.com/RemoteUserAPI
  3. The Authentication Token: Enter here the RealLoad ‘API Authentication Token’.
  4. Set the Refresh Interval to a value that is greater than 60 seconds.

Then click the ‘Test’ button near ‘Authentication Token’: Configure General Settings

Switch then to the AWS Tab and enter:

  1. The AWS Access Key ID
  2. The AWS Secret Access Key
  3. The Preferred Instance Type: We recommend that you enter t3.medium for your first attempt.
  4. Set the AWS EC2 Refresh Interval to a value that is greater than 60 seconds.
  5. 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’: Configure AWS Settings

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: Launch Instance

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. Confirm Launch Instance

The instance is then launched and in the state ‘pending’: Instance in ‘pending’ state

Now wait until the instance reaches the ‘running’ state. Then register the instance in the portal with a right mouse click: Register ‘running’ instance

The instance is now also displayed in ‘Portal Agents Registration’: Portal Agents Registration

Check in the RealLoad Portal whether the instance is running correctly by pinging the Measuring Agent at application level: Portal: Navigate to Measuring Agents

Portal: Ping Measuring Agent

Portal: Ping Measuring Agent - Result

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:

  1. Terminate the instance in AWS
  2. 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’: Terminate AWS Instance

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: Deregister Measuring Agent

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: AWS Console: EC2 Global View

In EC2 Global View click Global search and select the the tag REAL_LOAD_AGENT: AWS Console: Global search

Select the operator Equals and set the value to true, then hit the return key: AWS Console: Global search

If the list displayed contains one or more instances, click on the instance(s): AWS Console: Global search

Memorize the instance ID and terminate the instance: AWS Console: Terminate Instance

Sign in into the RealLoad Portal and delete the corresponding Measuring Agent: RealLoad Portal: Delete 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: AWS Console: Security Group

Launching a Measuring Agent Instance

When launching the instance click Browse more AMIs: AWS Console: Browse more AMIs

Then click Community AMIs, enter our (RealLoad) AWS account 775953462348 and select the Measuring Agent image: AWS Console: Community AMIs - Measuring Agent

Add the tag REAL_LOAD_AGENT = true AWS Console: Launch Instance - Add Tag

Select the Instance Type and set the (existing) Security Group “Real Load Agent Security Group”. Optionally you may also set a Key Pair: AWS Console: Launch Instance - Instance Type and Security Group

Scroll down and click Advanced Details: AWS Console: Launch Instance - 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

AWS Console: Launch Instance - Agent Secret

Scroll down to the bottom of the AWS Console and click Launch Instance: AWS Console: Click Launch Instance

After launching the instance click on the instance ID: AWS Console: Click on Instance ID

Copy the Public IPv4 address of the instance to a text editor or to the clipboard: AWS Console: Copy Public IPv4 address

Sign In to the RealLoad Portal and add (=register) the Measuring Agent instance: RealLoad Portal: Add Measuring Agent

The Agent IP Port wil always be 8080. Enter the Auth Token which you have set as AGENT_SECRET when launching the instance. RealLoad Portal: Add Measuring Agent

Then ping the Measuring Agent at application level: RealLoad Portal: Ping Measuring Agent

RealLoad Portal: Ping Measuring Agent

And check the Measuring Agent Log File to verify that the Agent Secret was configured: RealLoad Portal: Measuring Agent Log File

RealLoad Portal: Measuring Agent Log File

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.