Simple OpenShift CPU/Memory Benchmark

Florin Manaila
4 min readSep 29, 2020

I have been asked several times how we can do a simple test to show the OpenShift CPU and memory utilization as well as the scaling capabilities of the cluster. Bellow you cand find the details of such a test made with Apache and AB tool plus some interesting results on two different hardware architectures. I will try to write another article on how we can do a similar test with a Machine Learning code — stay around for the next article.

  1. The Container Image — Apache HTTP Server 2.4

This container image includes Apache HTTP Server 2.4 for OpenShift and general usage. Users can choose between RHEL, CentOS and Fedora based images.

The RHEL image is available in the Red Hat Container Catalog as registry.access.redhat.com/rhscl/httpd-24-rhel7. The CentOS image is then available on Docker Hub as centos/httpd-24-centos7.
Is a powerful, efficient, and extensible web server. Apache supports a variety of features, many implemented as compiled modules that extend the core functionality. These can range from server-side programming language support to authentication schemes. Virtual hosting allows one Apache installation to serve many different Web sites.”

The Source of the docker file container can be found on the bellow URL if you want to build it yourself.

https://github.com/sclorg/rhscl-dockerfiles/blob/master/rhel7.httpd24/Dockerfile

2. The Benchmark Tool

For benchmark let’s use ab — a tool for benchmarking your Apache Hypertext Transfer Protocol (HTTP) server. It is designed to give you an impression of how your current Apache installation performs. This especially shows you how many requests per second your Apache installation is capable of serving. More info about the ab tool can be found on bellow URL:
https://httpd.apache.org/docs/2.4/programs/ab.html

Suppose we want to see how fast the newly provision web server can handle 50000000 requests, with a maximum of 20 requests running concurrently:

ab -dSrk -c 20 -n 50000000 http://<webserver-IP>/index.php

Where:
-n requests = Number of requests to perform for the benchmarking session. The default is to just perform a single request which usually leads to non-representative benchmarking results.
-r = Don’t exit on socket receive errors.
-c concurrency = Number of multiple requests to perform at a time. Default is one request at a time
-S = Do not display the median and standard deviation values, nor display the warning/error messages when the average and median are more than one or two times the standard deviation apart. And default to the min/avg/max values. (legacy support).
-k = Enable the HTTP KeepAlive feature, i.e., perform multiple requests within one HTTP session. The default is no KeepAlive.

For the webserver IP, we can use those OpenShift variables:

$SCALE_SERVICE_HOST
$SCALE_SERVICE_PORT

OpenShift will automatically set those variables on all pods in the project, therefore we will use those in our ab tool URL request. In this case, our HTTP request will look like this inside the container:

ab -dSrk -c 20 -n 50000000 http://${SCALE_SERVICE_HOST}:${SCALE_SERVICE_PORT}/index.php

3. Assembly (container and benchmark)
The goal will be to build a new container with the http-24-rhel7 an ab tool to generate the workload, so the best will be to create a Dockerfile and have’it hosted on Github from where we can build the new container image and start our test. I hosted this Dockefile in a new git repository:
https://github.com/ticlazau/ocp-benchmark

5. Let’s Rock

I have provided the container image onto 10 PODs and then I wanted to have a look at the resource utilization of a single POD on both architecture and then to look at overall project CPU utilization.

Running 10 PODs
Monitoring a single POD
Monitoring a single POD
POD Linux kernel
POD running process
Apache HTTP server default page

Running and scaling across 10 PODs on two OpenShift architectures x86 and ppc64le we can see differences in CPU utilization between the two architecture, mostly because of POWER9 CPU efficiency and SMT4 for the given workload.

ppc64le Architecture — CPU Usage for 10 PODs = 6.0e-4
x86_64 Architecture — CPU Usage for 10 PODs = 1.2e-3

Monitoring Dashboard for the project
Monitoring for a while the CPU utilization for 10 PODs

For scaling of the test, you can increase the no of PODs to 100 or 1000 based on the cluster’s physical available resources.

In summary, is easy to do benchmarks cross hardware architectures as long as your container can be built on both platforms, and your needed custom software or tools are available as well.

--

--