This tutorial describes how to perform load testing using terraform with GCP VMs and ansible to run the commands.


Create a set of VMs with the following template (change the variables according to your environment):

resource "google_compute_instance" "test-instance" 
   name = "test-instance-${count.index}"
   zone = "$YOUR_REGION"
   project = "$YOUR_PROJECT"
   count = 3
   machine_type = "custom-4-16384"
   tags = ["test-instance"]
   allow_stopping_for_update = true

   boot_disk {
     initialize_params {
       image = "ubuntu-os-cloud/ubuntu-1804-lts"
       size = 100

   metadata = {
     ssh-keys = "root:$YOUR_PUBLIC_KEY"

   network_interface {
     network = "default"
     access_config {
       network_tier = "STANDARD"

resource "google_compute_firewall" "default" {
   name = "test-firewall"
   network = "default"
   source_ranges = [""]
   project = "$YOUR_PROJECT"
   priority = 1>

   allow {
     protocol = "tcp"
     ports = ["22", "80", "443", "3478", "4443", "5349"]

   allow {
     protocol = "udp"
     ports = ["1-65535"]

   target_tags = ["test-instance"]

This will create 3 instances in GCP with 4 cpu and 16gb of RAM.


After creating the instances, paste their public IPs to the hosts file in the current working directory. In the same directory, create an ansible.cfg file with the following contents:


host_key_checking =        no
inventory =          ./hosts
ansible_ssh_private_key_file =       ~/.ssh/id_rsa
ansible_user          = root
remote_user          = root

Create directory – load-test-templates and create the following files in the directory:


apt-get update
apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg \
    lsb-release -y

curl -fsSL | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

echo \
   "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] \
   $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

apt-get update
apt-get install docker-ce docker-ce-cli -y>

sudo curl -L "$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose


version: "3.3"
      image: meetrix/jitsi-meet-torture
      image: selenium/hub:3.141.59
      build: ./node
      image: meetrix/jitsi-meet-torture-selenium-node
          - /dev/shm:/dev/shm
          - hub
          HUB_HOST: hub


FROM meetrix/jitsi-meet-torture-selenium-node

Create an file with the following contents:

#!/usr/bin/env bash


ansible all -m copy -a "src=load-test-templates/ dest=/root owner=root mode=755"

ansible all -m shell -a "/root/"

ansible all -m shell -a "mkdir /root/node"

ansible all -m copy -a "src=load-test-templates/Dockerfile-for-load-testing dest=/root/node/Dockerfile owner=root mode=755"

ansible all -m copy -a "src=load-test-templates/docker-compose-load-test.yml dest=/root/docker-compose.yml owner=root mode=755"

ansible all -m shell -a "docker-compose up -d --scale node=2"

ansible all -m shell -a "docker-compose exec torture ./scripts/ --conferences=$CONFERENCES --participants=$PARTICIPANTS --senders=$PARTICIPANTS --audio-senders=$PARTICIPANTS --duration=30 --room-name-prefix=test --hub-url=http://hub:4444/wd/hub --instance-url=http://$YOUR_DOMAIN"

This will run a test on your Jitsi installation (without authentication), with 3 participants in 1 conference. The conference address will be $YOUR_DOMAIN/test0. Additional conferences (if you change $CONFERENCES value) will be named test1test2, etc.

For a seamless, secure and supported deployment of Jitsi on the cloud marketplaces, provided by Hossted, click here