SCREEN

In this guide, you will setup a complete performance testing environment that you can use for running Akamas optimization study for Konakart.

This setup is fully dockerized.

What you'll learn

What you'll need

While this guide is focused on building the performance testing environment, not on running the Akamas optimization (which is descriubed in the Akamas optimization study for Konakart guide), it may be useful to have a look at the high-level architecture that this setup will enable.

Architecture

First of all, install Docker on your Linux box:

sudo apt update && sudo apt install docker.io

Now enable the user ubuntu to run docker without sudo:

sudo usermod -aG docker $USER
newgrp docker

In this environment we leverage Docker Swarm, a Docker native container orchestration system. Even though in this scenario everything runs on a single machine, Swarm is handy as it provides the ability to specificy container resource limits (e.g. how many CPUs and how much memory the container can use) which they can very useful from a tuning perspective.

At this point, we can initialize Docker Swarm with this simple command:

docker swarm init

Your should see a message stating that Docker Swarm has been setup.

You now create a Docker network that all the containers will use to communicate:

docker network create -d overlay --attachable akamas_lab

In order to setup Konakart, first clone this repository:

git clone https://github.com/akamaslabs/konakart-docker.git

Now you can start Konakart by running:

docker stack deploy --compose-file konakart-docker/konakart/docker-compose.yml sut

You can now verify that Konakart is up and running by accessing your instance on port 8780:

SCREEN

Unless you plan to use a different load testing tool (such as LoadRunner Enteprise or Neotys NeoLoad), JMeter is a great choice to start using Akamas.

Setting up JMeter is straighfoward as a JMeter container comes already configured with test plans built for performance testing Konakart. Moreover, JMeter is already configured with the Prometheus integration so that performance test metrics (e.g. transaction throughput and transaction response time) are collected via Prometheus Listener for JMeter. You just need to verify the ability to launch a peformance test in this environment.

You can launch a first manual performance test by running the following command, where you need to replace YOUR_INSTANCE_ADDRESS with the address of your Konakart instance:

docker run --net=akamas_lab --rm --name jmeter -i -v $(pwd)/konakart-docker/jmeter:/tmp -w /tmp -p 9270:9270 chiabre/jmeter_plugins -t ramp_test_plan.jmx -JTARGET_HOST=YOUR_INSTANCE_ADDRESS

You should see an output similar to the one displayed here below, indicating that JMeter is running successfully:

START Running Jmeter on Fri Apr  2 06:35:35 UTC 2021
jmeter log level = OFF
jmeter defautl args -n -Dlog_level.jmeter=OFF -Jprometheus.ip=0.0.0.0
jmeter user args -t ramp_test_plan.jmx -JTARGET_HOST=konakart.dev.akamas.io -JTHREADS=40
Creating summariser <summary>
Created the tree successfully using ramp_test_plan.jmx
Starting standalone test @ Fri Apr 02 06:35:37 GMT 2021 (1617345337225)
Waiting for possible Shutdown/StopTestNow/HeapDump/ThreadDump message on port 4445
summary +    153 in 00:00:23 =    6.8/s Avg:    44 Min:     9 Max:  1300 Err:     0 (0.00%) Active: 5 Started: 5 Finished: 0
summary +    612 in 00:00:30 =   20.4/s Avg:    25 Min:     5 Max:   324 Err:     0 (0.00%) Active: 11 Started: 11 Finished: 0
summary =    765 in 00:00:53 =   14.5/s Avg:    29 Min:     5 Max:  1300 Err:     0 (0.00%)
summary +   1071 in 00:00:30 =   35.8/s Avg:    26 Min:     4 Max:   335 Err:     0 (0.00%) Active: 17 Started: 17 Finished: 0
summary =   1836 in 00:01:23 =   22.2/s Avg:    27 Min:     4 Max:  1300 Err:     0 (0.00%)
summary +   1408 in 00:00:30 =   46.9/s Avg:    60 Min:     4 Max:  1087 Err:     0 (0.00%) Active: 23 Started: 23 Finished: 0
summary =   3244 in 00:01:53 =   28.8/s Avg:    41 Min:     4 Max:  1300 Err:     0 (0.00%)
summary +   1831 in 00:00:30 =   61.0/s Avg:    60 Min:     4 Max:  1634 Err:     0 (0.00%) Active: 29 Started: 29 Finished: 0
summary =   5075 in 00:02:23 =   35.6/s Avg:    48 Min:     4 Max:  1634 Err:     0 (0.00%)
summary +   1913 in 00:00:30 =   63.7/s Avg:   137 Min:     5 Max:  2024 Err:     0 (0.00%) Active: 35 Started: 35 Finished: 0
summary =   6988 in 00:02:53 =   40.5/s Avg:    72 Min:     4 Max:  2024 Err:     0 (0.00%)
summary +   1785 in 00:00:28 =   63.3/s Avg:   225 Min:     8 Max:  2833 Err:     0 (0.00%) Active: 0 Started: 40 Finished: 40
summary =   8773 in 00:03:21 =   43.7/s Avg:   103 Min:     4 Max:  2833 Err:     0 (0.00%)
Tidying up ...    @ Fri Apr 02 06:38:58 GMT 2021 (1617345538215)
... end of run
END Running Jmeter on Fri Apr  2 06:38:58 UTC 2021

In case you see any errors (checkout the Err: column), chances are that JMeter cannot contact Konakart. Please verify that your instance address is correct and relauch the manual test until you are sure JMeter is running correctly.

Test plans

The JMeter docker image includes a couple of test plans described here below:

Ramp test plan

This test allows you to stress test Konakart with a ramp load profile. This profile is included in the ramp_test_plan.jmx file.

You can customize the profile by setting the following JMeter variables (see example above):

Plateau test plan

This test allows you to performance test Konakart with an initial ramp up and then with a constant load. This profile is included in the plateau_test_plan.jmx file.

You can customize the scenario by setting the following JMeter variables (see example above):

Unless you plan to use a different monitoring tool (such as Dynatrace), Prometheus is a great choice to start using Akamas.

Now that Konakart and JMeter are up and running, the last step is to setup Prometheus. In this scenario, Prometheus allows you to gather any metrics you will need for your Akamas optimizations, for example the performance test metrics measured by JMeter (e.g. transaction throughput and response time) or related to application resource usage.

This environment also includes a number of useful dashboards that you can use to monitor the application, infrastructure and load testing key metrics.

By running the following command you can launch Prometheus and Grafana, plus a set of preconfigured dashboards to monitor your load tests:

docker stack deploy -c konakart-docker/monitoring/docker-compose.yml monitoring

The following is a quick overview of the preconfigured dashboards that you can use to monitor the application, infrastructure and load testing key metrics. These dashboards are available as part of the Prometheus installation.

You can view these dashboard by accessing Grafana on port 3000 of your Konakart instance.

JMeter Exporter

The JMeter dashboard allows you to monitor your performance tests.

For example, run again the JMeter perfomance test described before and see results in the JMeter dashboard:

SCREEN

Docker Container

The Docker dashboard allows you to see the resource consumption of your containers, including the Konakart application:

SCREEN

JMX Exporter

The Node dashboard allows you to see the OS-level Linux performance metrics of your instance:

SCREEN

Congratulations, you have successfully installed the Konakart performance environment!

You are now ready to start the real fun - that is optimizing Konakart application performance with Akamas.

© Akamas Spa 2018-present. Akamas and the Akamas logo are registered trademarks of Akamas Spa.