Skip to content

LSS-USP/web_server_benchmark

Repository files navigation

What is web server benchmark?


In a few words, this repository keeps an automated benchmark for web servers (specially Apache httpd).

Personally, I do not trust in most of the web server benchmarks that I have seen on the Internet. Why? Many of them don't clearly state what kind of configuration and environment was used in their tests. By this reason, I decided to create my own test environment with focus on the reproducibility of the data and honesty with results.

With this in mind, I focused on three things:

  • Reproducibility: Provide a structure which everybody can easily reproduce the results;
  • Scalability: Structure which everybody can deploy locally in a set of virtual machine (development environment), or in a bunch of computers, or even in any servers in anywhere;
  • Extensible: Something easy to add features and behaviours.

Structure overview

Kuniri

> Basically, this benchmark uses two host machines: one for Apache Httpd and another that fired thousands of requests. The machine that host the Httpd has a lot of specific configuration and some specific mpm strategies defined. The second machine its design to 'hammering' the Httpd web server. Finally, you can handle all of it from your computer using some tasks (explained in the section below).

Usage

Dependencies

  • Python 2
  • R
  • Ansible 2.1
  • Rake 11.1

Development environment

To make easy to reproduce try this benchmark or adapt it, we have the option to run it inside a virtual machine. This setting relies in some additional softwares, that you have to install. First of all, you have to install:

  • Virtualbox 5
  • Vagrant 1.8

Secondly, you need to configure your public key. If you not have a public key, generate an SSH key. Copy your id_rsa.pub inside /vagrant folder.

cp ~/.ssh/id_rsa.pub /vagrant

The next step, it is create the virtual machine to execute the web server and other to execute the stress script. Just type:

rake vms:configure

The last step is not required every time, only if you destroy all the virtual machines (vms) or if it is the first time you execute this command. The following command it is the required to wake up your vms:

rake vms:wakeup

Finally, It is good to say that we have some additional commands to work with our vms:

rake vms:configure      # Configure all machines
rake vms:destroyall     # Destroy all vms
rake vms:haltall        # Halt all vms
rake vms:wakeup         # Start all virtual machines

Ps.: Keep reading, you have to deploy (next section)

Deploy

Our deploy has two requirements in the remote machine:

  • Python 2 installed
  • Connecting via SSH
  • Root privileges

Finally, you just have to type the following command to deploy:

rake deploy

This command just enters in both machines, install and configure it.

Execute the benchmark

To execute the banchmark just type:

rake benchmark:run

You have to wait a little bit here...

See the results

If you want to see the results generated by the benchmark, take a look at the results folder. If you want to plot the results, just type:

rake results:graphs