Deploy Dockerized load generators on Linux

This section describes how to run a Dockerized load generator on a Linux distribution.

Docker is a platform that allows you to develop, ship, and run applications using a container. Refer to the product documentation for more details.

Note: For supported protocols on Dockerized load generators, see the Supported Protocols guide.

Prerequisites

Below is a list of prerequisites that are required to run a Dockerized load generator on a Linux distribution.

Prerequisite Description
Install Docker

Install Docker on the target machine, along with its dependencies, and set up the target machine environment as required. Currently, only the 64-bit version is supported.

Obtain Docker image

Obtain the predefined load generator Docker image. Two images are available, Linux-Ubuntu and RHEL.

Pull the image from the from the relevant page, accessible from the performance testing page (https://hub.docker.com/u/performancetesting) in the Docker hub.

Use the following commands and appropriate <tag version number>, for example, 25.3:

Linux-Ubuntu:

docker pull performancetesting/opentext_onelg_ubuntu:<tag version number>

RHEL:

docker pull performancetesting/opentext_onelg_rhel:<tag version number>

Note: The Ubuntu image for the OneLG load generator replaces the previous Ubuntu load generator docker image.

Back to top

Run a Dockerized load generator using the predefined image

Use the ready-to-use image to run a load generator on Docker for Linux. If you need customization for your container, for example, for proxy servers, see Run a Dockerized load generator using a custom image.

Note:  

  • The following environment variables are available to enable JMeter and Gatling on the load generator if required:

    • ENABLE_JMETER

    • ENABLE_GATLING

  • If one Docker load generator is configured with either JMeter or Gatling scripts or both, then all Dockers load generators get these flags as well, even if they are configured with other scripts types.

To run a Dockerized load generator:

Run the load generator container using the following command for Linux-Ubuntu or RHEL.

Linux-Ubuntu:

Copy code
docker run -id -p <host_port>:54345 -e "ONELG_FLAVOR=1" -e "ENABLE_GATLING=1" -e "ENABLE_JMETER=1" --net=host performancetesting/opentext_onelg_ubuntu:<tag version number>

RHEL:

Copy code
docker run -id -p <host_port>:54345 -e "ENABLE_GATLING=1" -e "ENABLE_JMETER=1" performancetesting/opentext_onelg_rhel:<tag version number>

Note: Check that the <host_port> on the Linux machine is available and allows incoming requests. Specify this port on the Controller side when connecting to this load generator.

Example using SSH

The following gives a simple C# code example for running multiple load generator containers using SSH. There are container orchestrator tools which do the same, for example, Kubernetes.

Copy code
using (var client = new SshClient(dockerHost, dockerHostUserName, dockerHostPasswd))
{
  client.Connect();
  for (int i =0; i > numOfContainers; i++)
  {
    string command = "docker run -id -p " + lgInitialPort + i) + ":54345 performancetesting/opentext_onelg_ubuntu:<tag version number>";
    var terminal = client.RunCommand(command);
    if (terminal.ExistStatus != 0)
    {
    throw new Exception("Failed to create new Docker container");
    }
    Console.WriteLine("Docker LG with external port" + lgInitialPort + i + "created.");
  }
  client.Disconnect();
}

Back to top

Run a Dockerized load generator using a custom image

If your environment requires customized settings for running the container, for example for proxy servers, you can create a Dockerfile to build a custom image.

Note: Another alternative for customized settings: Start the container; once it is running, set up the load generator environment variables, then start the load generator manually inside the container.

To run a custom Dockerized load generator:

  1. Create a new folder, and within it create a file named dockerfile. Paste the FROM line, plus the required customization lines, into the file, using the appropriate OpenText Enterprise Performance Engineering version for the <tag version number>:

    Copy code
    FROM performancetesting/opentext_onelg_ubuntu:<tag version number>ENV http_proxy http://my_proxy_name:port

    Note: The above customization example is for a proxy. It defines an environment variable for the proxy server host and port in the target image.

  2. Save the Dockerfile.

  3. Open a command line at the dockerfile folder path and run the following command, using the name you want for your custom image.

    Linux-Ubuntu:

    Copy code
    docker build -t <custom dockerfile name> .

    RHEL:

    Copy code
    docker build -t <custom dockerfile name> .
  4. Create a container for each load generator you want to use, by running the following command.

    Linux-Ubuntu:

    Copy code
    docker run -id -p <host_port>:54345 <custom image name>

    RHEL:

    Copy code
    docker run -id -p <host_port>:54345 <custom image name>

    If the custom image in step 3 was built with a tag then include it in the command:

    Copy code
    docker run -id -p <host_port>:54345 <custom image name>:<tag version number>

    Note: Check that the <host_port> on the Linux machine is available and allows incoming requests. Specify this port on the Controller side when connecting to this load generator.

Back to top

Build Ubuntu Docker image to run TruClient 2.0

To run TruClient 2.0 scripts on Docker on-premises load generators, you must install the Chrome or Edge browser manually, and then build your own customized Ubuntu OneLG image using the Dockerfile sample below.

To build an Ubuntu Docker image to run TruClient 2.0:

  1. Create a new folder, and within it create a file named dockerfile.

  2. Copy the following text to the dockerfile file:

    Copy code
    FROM performancetesting/opentext_onelg_ubuntu:<tag version number>
    USER root
    RUN apt-get update \
    && apt install wget -y \
    && wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
    && apt install fonts-liberation libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libcairo2 libcurl3-gnutls libdrm2 libgbm1 libgtk-3-0 libpango-1.0-0 libu2f-udev libvulkan1 libx11-6 libxcb1 libxcomposite1 libxdamage1 libxext6 libxfixes3 libxkbcommon0 libxrandr2 xdg-utils -y \
    && dpkg -i google-chrome-stable_current_amd64.deb \
    && rm google-chrome-stable_current_amd64.deb \
    && apt update \
    && apt upgrade -y \
    && apt --fix-broken install \
    && apt install software-properties-common apt-transport-https curl ca-certificates -y \
    && curl -fSsL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /usr/share/keyrings/microsoft-edge.gpg > /dev/null \
    && echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft-edge.gpg] https://packages.microsoft.com/repos/edge stable main' | tee /etc/apt/sources.list.d/microsoft-edge.list \
    && apt update \
    && apt install microsoft-edge-stable
  3. Save the file.

  4. In the FROM line, replace <tag version number> with the appropriate Ubuntu One LG image tag, for example, 25.1 or later.

  5. Run the following command:

    sudo docker build -t <custom image name>

Note: If the Chrome installation needs a dependency, add libasound2t64 in line 6 as follows:

&& apt install fonts-liberation libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libcairo2 libcurl3-gnutls libdrm2 libgbm1 libgtk-3-0 libpango-1.0-0 libu2f-udev libvulkan1 libx11-6 libxcb1 libxcomposite1 libxdamage1 libxext6 libxfixes3 libxkbcommon0 libxrandr2 xdg-utils libasound2t64 -y \

Back to top

After running the load generator containers

Add the load generators containers to your tests.

Back to top

Tips and guidelines

  • Dockerized load generators, run from the predefined image, are not supported when running over a firewall. (Solution for advanced users: You can develop your own Docker image with MI Listener support.)

  • Use docker ps to list the containers that are running.

  • To stop the load generator service:

    • Use docker stop <load generator container name or ID> if you want to reuse the same load generator.

    • Use docker rm -f <load generator container name or ID> to remove the load generator container.

  • The Dockerfile container has an ENTRYPOINT section. The container first runs the commands in ENTRYPOINT. It sets up the environment and then starts the load generator. The command uses a While loop to wait for input, to keep the container from exiting. This behavior prevents you from accessing the container while it is running. Add -i when starting the container to prevent the While loop from consuming an excessive amount of CPU.

  • If you need entry into the container, add an argument such as --entrypoint=/bin/bash when starting the container. After entering the container, set the load generator environments and start the load generator. You can then switch to the host using CTRL+p and CTRL+q while keeping the container running in the background. To access the container again, use the docker attach container_id command.

  • To access the host network directly, use --net=host in place of -p <host_port>:54345. We recommend you use this flag if the AUT generates a lot of network activity.

Back to top