RedLine13 offers users the ability to scale out custom python load tests in their own AWS environment. In this video, we demonstrate uploading and running a simple python test on RedLine13, showing how simple and cost-effective it is to run python load tests with RedLine13.
Getting Started
When running a custom python load test on RedLine13, we begin by logging into our account, hitting “Start Test”, and then navigating to the “Custom Test” tab.
One will need to prepare a python load test beforehand. Here we use an example test that can by found on our GitHub (login_load_test.py). This test simulates a user logging into Dictionary.com, hitting a few endpoints, and then we have the test generate a fake URL error.
To run this test, we first need to create a Dictionary.com account, which we then input said username and password into the test:
from load_testing_test import LoadTestingTest import record_helpers import time import sys class LoginLoadTest(LoadTestingTest): """Example testing a login page on dictionary.com. To play with this test create an account on dictionary.com and use your username+password in the definition above. The parent class documentation see: https://www.redline13.com/customTestDoc/class-LoadTestingTest.html """ SITE_USERNAME = '<site_username>' SITE_PASSWORD = '<site_password>' def __init__(self, test_num, rand): """Constructor needs to pass up the information :param test_num: int Test number, if you if you specify simulate 40 users - this represents that user :param rand: string The rand is a token used to keep track of this test, not used, just pass to parent """ super(LoginLoadTest, self).__init__(test_num, rand)
Configuring Parameters
Once we have created our test, we then upload the custom python load test to RedLine13 where we can then begin to edit certain parameters. Here we can edit the number of users, attach additional CSV files, and save our response output and percentiles (pro only). In this example we start out by simulating 20 users:
Next, we scroll down to expand the “Advanced Cloud Options” tab to fine tune our load test. Here we can control a range of parameters like the size and location of the EC2 instances we will be using. In this example we ran our test on two, m3.medium spot instances in California, with 10 users per server:
After we configure the parameters of our test, we are then are ready to start load testing. The servers begin to launch and our test begins shortly. Once completed, we are then redirected to the results page where we can analyze what happened during our test:
The results page provides you with a breakdown of request metrics, response metrics, load agent metrics, errors, and agent metrics. In this example test we found that out of the 100 requests that were made, 99% were completed within the first 7.02 seconds of the 10 second load test.
Running a custom python load test on RedLine13 is as simple as uploading a file, configuring a few parameters, and then sitting back as the EC2 instances do all the work.