Manually Configure Dockerized Load Generators

This section describes how to install load generators on a Linux platform using Docker, and how to manually assign the load generators to a performance test.

Note:  

  • Dockerized load generators are only supported on Linux-based Docker containers. They are not supported when running over a firewall.

  • Alternatively, you can use elastic load generator provisioning to dynamically assign dockerized load generators to a performance test. For details, see Manage Elastic Load Generators.

Benefits of using dockerized load generators

Docker is a platform that allows you to develop, ship, and run applications via a container. Docker uses a standard container format that lets developers prepare applications inside containers, while system administrators and other teams, such as Quality Assurance engineers, run the container in order to deploy the application. For details regarding Docker, see https://docs.docker.com.

Using dockerized load generators:

  • Enables you to automate the testing process by provisioning and de-provisioning load generators on demand, and seamlessly add them to performance tests using the REST API.

  • Saves having to rely on (and manage) load generators defined in the lab, and the need to reserve load generators in advance.

Back to top

Set up an installation using Docker

  1. Prerequisites

    Make sure Docker is installed on a Linux environment, and that iptables is running on your system. For installation details, see the Docker documentation.

  2. Obtain the Dockerfile image

    Locate the base load generator image. Use the image provided in the Performance Center installation directory (in the InsData folder of the ISO file) or obtain one from the Docker hub.

  3. Create Docker containers

    Create a Docker container for each load generator you want to add to the test by running the following command (make a note of the host port that is mapped to each container, because you will need it when configuring each Load Generator host):

    docker run -id -p <host_port>:54345 performancetesting/load_generator_linux

    Note: If you do not have internet access from the load generator machine, you can download the Load Generator image from the Performance Center installation directory by clicking Download Docker Image.

  4. Add Dockerized load generators to the test

    You can automatically assign Dockerized load generators to tests from the Performance Center REST API, or assign them manually from the Performance Center user interface. For details, see:

Back to top

Add dockerized load generators to tests from the REST API

  1. Prerequisite

    Set up the Docker installation as described in Set up an installation using Docker.

  2. Add Dockerized load generators to the Performance Center Hosts list

    1. Authenticate the user to the Performance Center Administration REST API by sending an HTTP GET request to the following URL:

      http://<Performance Center server>/Admin/rest/authentication-point/authenticate

      Example: GET /Admin/rest/authentication-point/authenticate

      For API details, see Authenticate in the Performance Center Administration REST API Guide.

    2. Add a load generator to each Docker container using the Get Hosts API, and configure the settings as follows:

      • For host name, enter the physical name of the load generator host followed by _dkr_<lgInitialPort>, where <lgInitialPort> is the initial port that is mapped to the Docker container (see step 2).

        Example: myHost_dkr_10110

      • Add the container as a Unix installation, with LoadGenerator purpose.

        Request example:

      For API details, see Add Host in the Performance Center Administration REST API Guide.

      The Dockerized load generators are added the Hosts list.

  3. Run the performance test

    1. Prerequisites

      Make sure you have created a performance test, and configured it to use non-specific (automatch) load generators. You can also use specific load generators, but then you need to update your test to use those load generators (this can be done using tests/{ID} in the Performance Center REST API Guide).

      You can create a test either from the Performance Center Administration REST API (see tests in the Performance Center REST API Guide), or manually from the Performance Center user interface (see How to Design a Performance Test).

    2. Run the performance test from the Performance Center REST API (see Start a Test Run in the Performance Center REST API Guide).

  4. Gather results

    When the performance test has finished running, collate (and analyze) performance test data using the REST API. For API details, see collate and analyze in the Performance Center REST API Guide.

  5. Remove the load generators from the test - optional

    Note: Make sure you collate the results for any load generators you intend to remove from the test before you delete them.

    1. Remove the load generators from the test using the hosts/{hostID} API. For API details, see hosts/{hostID} in the Performance Center Administration REST API Guide.

    2. Delete all Docker containers by running the following command:

      "docker rm -f $(docker ps -a -q)";

Back to top

Manually configure and assign dockerized load generators to tests

  1. Prerequisite

    Set up the Docker installation as described in Set up an installation using Docker.

  2. In Performance Center Administration, select Management > Hosts.

  3. Select the Hosts tab, and then click Create New Host .

  4. Configure the host settings as follows:

    • Host Name. Enter the physical name of the host followed by _dkr_<port_number>, where <port_number> is the port that is mapped to the Docker container.

      Example: myHost_dkr_10110

    • Purpose. Select Load Generator only.

    • Installation. Select Unix Load Generator.

  5. Click Save to add the host to the Hosts grid.

  6. In My Performance Center, assign the load generator to a test. For details, see Distribute load generators among Vuser groups in a test.

Back to top

Notes and Limitations

This section contains notes and limitations for dockerized load generators.

  • If Security-Enhanced Linux (SELinux) is enabled on your Linux operating system, it can prevent Docker containers from loading the required load generator libraries.

    Workaround: Contact your IT department to configure SELinux so that it will still be effective while letting the load generators load the required libraries for them to operate.

  • Any errors encountered by dockerized load generators are written to the Event log under the docker node host name and port.

Back to top

See also: