Testing in the cloud
Launching LoadUI agents in the Amazon cloud
You can launch any number of LoadUI agents, anywhere in the world, with a couple of clicks! We won't charge you a dime (Amazon might though). Simply go to the LoadUI agent in AWS Marketplace and click Continue:
If you're not logged in to an Amazon AWS account, you'll be asked to do so (or register a new account, but chances are that your company already has an account). Once you're logged in, click Launch with 1-click to launch a new agent:
Connect LoadUI to your Amazon Agent
Upon launching an agent, you'll see the An instance of this software is now deploying on EC2 dialog (shown below). In order to connect to this agent from LoadUI, we need to know its public DNS. To do so, click AWS Management Console:
The AWS Management Console will now open, with your LoadUI agent selected. The public DNS of the agent will be similar to ec2-54-211-200-0.compute-1.amazonaws.com and can be found at the bottom of the screen:
Now open LoadUI Pro. In the workspace view and drag a new agent out from the toolbox. As the Agent URL enter the public DNS.
LoadUI Pro will now add the agent and you're ready to load test in the cloud!
Connecting using SSH
Sometimes you want to customize error-handling or you might want to install additional services on your Instance. This is done by right-clicking your instance and selecting Connect from here you can chose whether to Connect with a standalone SSH Client like putty in windows or ssh-command in mac or linux. But easiest is clicking Launch SSH Client-button in the Connect-view using username: ubuntu, you also need to provide the .pem-file.
Using your favourite ssh-client you can now navigate the file structure of the instance.
Restarting your agent
Either use the AWS control panel and right-click the instance and choose reboot. Alternatively you can do it from command-line as follows.
If you want to stop the agent running on this instance simply type the following command:
If you want to start it again:
Turn off logging
If you want to turn off logging or otherwise modify the startup procedures the you should open an SSH session and then firing your favourite text editor (for this example we use nano that is preinstalled)
sudo nano /etc/init.d/loadui-agent
This takes you to the init script using the editor-of-choice:
Simply change the line saying:
bash -c "$LOADUI_AGENT > $HOME/loadui-agent.log" ubuntu &
to instead say
bash -c "$LOADUI_AGENT" ubuntu &
now press ctrl + O in nano to write to file followed by ctrl + X to exit the editor.
now you must restart the Loadui-agent process, using:
in order to apply the new startup-settings
What is Distribution?
What is a distributed test?
A distributed test is a single test that is run from several different computers at the same time.
Why do I want to use a distributed test?
Running load tests often involves generating a lot of traffic to simulate a large number of users. This can become physically difficult to do using a single computer, due to the required amount of computer resources needed to handle this vast amount of requests and responses.
This will also provide a more realistic test, since it is unlikely that all access to your system would come from a single computer, so running distributed tests servers to make the simulation closer to actual user behaviour.
How does LoadUI support running distributed tests?
In LoadUI, we've made distributed testing easy to do. Each LoadUI VU Scenario can be distributed out to a number of LoadUI agents (an agent is simply another machine on the network which is running the LoadUI agent software), where it will be executed just like in the desktop loadUI application. The physical location of a LoadUI agent can also be remote, which more accurately simulates traffic coming from outside the network. You can even deploy a LoadUI agent AMI (Amazon Machine Image) to the Amazon EC2 service, allowing you to outsource the traffic generation to the cloud, without needing to run and maintain the hardware for it yourself.
Getting Started with Distribution
One of the most powerful features of LoadUI is the ability to distribute a Virtual User Scenario to agents, to better model the type of load that the system you are testing can expect.
Distribution is only available in LoadUI Pro. So it is recommended that you download a free trial of LoadUI Pro before starting this tutorial.
I this tutorial, we will learn how to:
- Create a VU Scenario.
- Place that VU Scenario on an agent.
- View chart lines grouped by agents.
Connecting to an agent
Start by closing any opened project to get to the Workspace View. Add an agent by dragging the New Agent icon to the Agents list.
The new agent dialog that will appear lets you type URL to an agent machine — or check agents in the list of detected agents in your local network.
Creating a Scenario
To have something to distribute to agents, you need to create a Virtual User Scenario. A Scenario is simply a component that can contain other components, and be distributed to agents.
Drag the VU Scenario icon from the Components Toolbar to create a Scenario, and then double click its black area to edit its contents.
A Scenario is like a miniature project; it has its own collection of components, execution settings, etc. Scenarios are edited in the Scenario View.
You can tell that you are in fact editing a Scenario by looking at the number of stacked bars ( and ). Create a Fixed Rate Generator and a Web Page Runner and connect the two. Return to the Project View by closing the Scenario view . Your Scenario will now look like this:
Distributing a Scenario
A VU Scenario can be run locally, without any agents; but that is not what you are here for!
Expand the Distribution bottom panel. You will see a toolbox containing all the Scenarios in the current project. To distribute your Scenario, just drag it from the toolbox to your agent:
In this tutorial, we will distribute our simple VU Scenario to two agents.
Change running mode by using the drop down next to the play button:
It is time to start your test! Hit play and create a chart for the Web Page Runner in the Statistics Workbench. You can now see sub charts from each individual agent by toggling the Agents panel (click ).
Remember that each agent is running a complete copy of the Scenario; this means that the total load will be higher. For example, we can see above that both agents are hitting the web server at 10 TPS (Transactions Per Second) each, resulting in a 20 TPS total load on the server.
LoadUI will stay in distributed mode until you switch back to local mode. Try to keep this in mind as it might otherwise cause confusion the next time you run a test.
To maximize the load, run the LoadUI controller in command line mode.
Working with Web Load Tests
Working with Web Load Tests