This directory contains the Theodolite framework for executing scalability benchmarks in a Kubernetes cluster. As Theodolite aims for executing benchmarks in realistic execution environments, some third-party components are required. After everything is installed and configured, you can move on the execution of benchmarks.
For executing benchmarks, access to Kubernetes cluster is required. We suggest to create a dedicated namespace for executing our benchmarks. The following services need to be available as well.
We suggest to use the Prometheus Operator and create a dedicated Prometheus instance for these benchmarks.
If Prometheus Operator is not already available on your cluster, a convenient way to install is via the unofficial Prometheus Operator Helm chart. As you may not need an entire cluster monitoring stack, you can use our Helm configuration to only install the operator:
helm install prometheus-operator stable/prometheus-operator -f infrastructure/prometheus/helm-values.yamlAfter installation, you need to create a Prometheus instance:
kubectl apply -f infrastructure/prometheus/prometheus.yamlYou might also need to apply the ServiceAccount, ClusterRole and the CusterRoleBinding, depending on your cluster's security policies.
For the individual benchmarking components to be monitored, ServiceMonitors are used. See the corresponding sections below for how to install them.
As with Prometheus, we suggest to create a dedicated Grafana instance. Grafana with our default configuration can be installed with Helm:
helm install grafana stable/grafana -f infrastructure/grafana/values.yamlThe official Grafana Helm Chart repository provides further documentation including a table of configuration options.
We provide ConfigMaps for a Grafana dashboard and a Grafana data source.
Create the Configmap for the dashboard:
kubectl apply -f infrastructure/grafana/dashboard-config-map.yamlCreate the Configmap for the data source:
kubectl apply -f infrastructure/grafana/prometheus-datasource-config-map.yamlIn order to use the Flink Dashboard, import the JSON located in infrastructure/grafana/flink-scalability-benchmarking-dashboard.json from the UI.
One possible way to set up a Kafka cluster is via Confluent's Helm Charts. For using these Helm charts and conjuction with the Prometheus Operator (see below), we provide a patch for these helm charts. Note that this patch is only required for observation and not for the actual benchmark execution and evaluation.
To use our patched Confluent Helm Charts clone the chart's repsoitory. We also provide a default configuration. If you do not want to deploy 10 Kafka and 3 Zookeeper instances, alter the configuration file accordingly. To install Confluent's Kafka and use the configuration:
helm install my-confluent <path-to-cp-helm-charts> -f infrastructure/kafka/values.yamlTo let Prometheus scrape Kafka metrics, deploy a ServiceMonitor:
kubectl apply -f infrastructure/kafka/service-monitor.yamlOther Kafka deployments, for example, using Strimzi, should work in a similar way.
A deployment of a permanently running pod used for Kafka configuration is started via:
kubectl apply -f infrastructure/kafka/kafka-client.yaml Lightbend's Kafka Lag Exporter can be installed via Helm. We also provide a default configuration. To install it:
helm install kafka-lag-exporter https://github.com/lightbend/kafka-lag-exporter/releases/download/v0.6.3/kafka-lag-exporter-0.6.3.tgz -f infrastructure/kafka-lag-exporter/values.yamlNote: use version 0.6.3 to work with Flink, versions < 0.6.3 did not pick up the consumer offset that Flink commits
For executing benchmarks, a Python 3.7 installation is required. We suggest
to use a virtual environment placed in the .venv directory (in the Theodolite
root directory). As set of requirements is needed. You can install them with the following
command (make sure to be in your virtual environment if you use one):
pip install -r requirements.txt The setup of the Flink cluster is taken care of by the run scripts. The number of taskslots should be configured inside of the run_uc*-new.sh scripts, as the Flink parallelism is calculated by multiplication of the number of taskslots with the number of instances. Additional Flink configurations can be added through the flink configmap file and the job configuration through environment variables in the jobmanager-job and taskmanager-job-deployment files. Those files are located in the uc*-application directories.
Depending on your setup, some additional adjustments may be necessary:
- Change Kafka and Zookeeper servers in the Kubernetes deployments (uc1-application etc.) and
run_XX.shscripts - Change Prometheus' URL in
lag_analysis.py - Change the path to your Python 3.7 virtual environment in the
run_XX.shschripts (to find the venv'sbin/activate) - Change the name of your Kubernetes namespace for Prometheus' ClusterRoleBinding
- Please let us know if there are further adjustments necessary
The ./run_loop.sh is the entrypoint for all benchmark executions. Is has to be called as follows:
./run_loop.sh <use-case> <wl-values> <instances> <partitions> <cpu-limit> <memory-limit> <commit-interval> <duration><use-case>: Stream processing use case to be benchmarked. Has to be one of1,2,3or4.<wl-values>: Values for the workload generator to be tested, separated by commas. For example100000,200000,300000.<instances>: Numbers of instances to be benchmarked, separated by commas. For example1,2,3,4.<partitions>: Number of partitions for Kafka topics. Optional. Default40.<cpu-limit>: Kubernetes CPU limit. Optional. Default1000m.<memory-limit>: Kubernetes and Flink memory limit. Optional. Default4G. (only use M or G not Mi or Gi in order to work with Flink)<commit-interval>: Flink checkpointing interval and Kafka commit interval in milliseconds. Optional. Default100.<duration>: Duration in minutes subexperiments should be executed for. Optional. Default5.