Setting up a Konakart environment for testing Akamas
This page describes how to setup a simple yet complete performance testing environment that you can use for running Akamas offline optimization study:
The target application is Konakart, a real-world Java-based e-commerce application
JMeter will be used to execute stress tests, with built-in sample scenarios
Prometheus will be used to monitor the environment (load test, JVM and OS metrics)
Reference Architecture
The following picture describes the high-level Akamas architecture that is enabled by this setup.
![](https://docs.akamas.io/~gitbook/image?url=https%3A%2F%2F3774185011-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FJSNpKvJ3IYa5Vo69I0ed%252Fuploads%252Fgit-blob-b9c2b211fae6e406744256e5f19bf0269b04833c%252Farchitecture.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=476898da&sv=1)
Setup Docker Swarm
First of all, install Docker on your Linux box:
Now enable the user ubuntu
to run docker without sudo
:
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 specify container resource limits (e.g. how many CPUs and how much memory the container can use) which can be very useful from a tuning perspective.
At this point, we can initialize Docker Swarm with this simple command:
You 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:
Setup Konakart
In order to setup Konakart, first clone this repository:
Now you can start Konakart by running:
You can now verify that Konakart is up and running by accessing your instance on port 8780
:
![](https://docs.akamas.io/~gitbook/image?url=https%3A%2F%2F3774185011-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FJSNpKvJ3IYa5Vo69I0ed%252Fuploads%252Fgit-blob-f86748fbb2e74c0a0f1bc8223d4de0ff74bf7a7f%252Fkonakart-home.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=837e5b72&sv=1)
Setup JMeter (optional)
Unless you plan to use a different load testing tool (such as LoadRunner Enterprise or Neotys NeoLoad), JMeter is a great choice to start using Akamas.
Setting up JMeter is straightforward 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 performance 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:
You should see an output similar to the one displayed here below, indicating that JMeter is running successfully:
In case you see any errors (check out the Err:
column), chances are that JMeter cannot contact Konakart. Please verify that your instance address is correct and relaunch 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 the example above):
THREADS
, the maximum number of virtual users (default 20)RAMP_SEC
, the load test duration in seconds (default 200)
Plateau test plan
This test allows you to do a performance test of 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 the example above):
THREADS
, the maximum number of virtual users (default 20)RAMP_UP_MIN
, the ramp-up duration in minutes (default 1)RAMP_UP_COUNT
, the number of steps in the ramp (default 5)HOLD_MIN
, the plateau duration in minutes (default 5)
Setup Prometheus (optional)
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:
Explore Grafana dashboards (optional)
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 this 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 performance test described before and see the results in the JMeter dashboard:
![](https://docs.akamas.io/~gitbook/image?url=https%3A%2F%2F3774185011-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FJSNpKvJ3IYa5Vo69I0ed%252Fuploads%252Fgit-blob-9623f0680c50935ed680bf89081a67bee5497042%252Fjmeter-dash.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=8cd38823&sv=1)
Docker Container
The Docker dashboard allows you to see the resource consumption of your containers, including the Konakart application:
![](https://docs.akamas.io/~gitbook/image?url=https%3A%2F%2F3774185011-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FJSNpKvJ3IYa5Vo69I0ed%252Fuploads%252Fgit-blob-3c95be9c858a18618d82f6c600be24b0d4b56f35%252Fdocker-dash.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=a44e9c07&sv=1)
JMX Exporter
The Node dashboard allows you to see the OS-level Linux performance metrics of your instance:
![](https://docs.akamas.io/~gitbook/image?url=https%3A%2F%2F3774185011-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FJSNpKvJ3IYa5Vo69I0ed%252Fuploads%252Fgit-blob-3c95be9c858a18618d82f6c600be24b0d4b56f35%252Fdocker-dash.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=a44e9c07&sv=1)
At this point, you have a simple test environment for your Akamas optimizations.
Last updated