image HTTP testing with Postman image Tools for working remotely – not only in time of COVID-19 epidemic

HTTP load testing with Bombardier part 1

bombardier

Recently I went deep with the load testing with the special tool called Bombardier! It’s a command-line tool for running HTTP load tests and boy it’s a nice tool.

First some basics. If you check Wikipedia you can find this definition: “Load testing generally refers to the practice of modeling the expected usage of a software program by simulating multiple users accessing the program concurrently.”

This is part 1 of a comprehensive load testing story that we will develop in the coming weeks. I will start with a quick guide on how to use the Bombardier to test your HTTP endpoint or website from the command-line.

Installation

Please go to the Bombardier Github page and download the tool for your operating system. I am using version 1.2.4 in this blog post.

Getting started

Ok, if you installed it, let’s run bombardier –version from the command line. We get back:

All good, let’s write a very basic load test with 1 concurrent user to our servers. Please use this only against your own servers! We will test API endpoint https://myserver/api/v1/countries with GET HTTP verb, with 1 user for 1 second. Here is the command:

The syntax is pretty much self-explanatory, I suggest you look at the official documentation page. I will not address all of the features Bombardier supports, but you’ll get enough examples to get you going.

Now let’s run the command above.

Obviously this is the minimal test we can do :). You can see the statistics in the results output with requests per second, latency and HTTP codes. We can easily expand these statistics a bit by adding latency distribution with the -l argument, like this:

Next, we can add focus on adding HTTP headers. We will add two Content-Type and Authorization with JWT token. Here is the example of the command:

Ok, now let’s call a POST method with a JSON payload. Here is a comment thou. I did not manage to successfully call the JSON inline in the command. I must be doing something wrong, so If anyone knows how to do that, please let me know :). So I solved this by saving the JSON payload to the file and reference it from the command. Here is the payload.json content:

This was successful, but for you who would like to debug the issue with inline JSON payload, here are the two variations I tried without success.

and escaping “:

Hit me up on LinkedIn or comment below if you have a solution :).

That’s all for this post, please check my page in the coming weeks for the next level where we will use of the Bombardier in your DevOps deployment pipeline. I am really looking forward to that :).

Ta-da

About Miha
I've always been fascinated by computers. I am happy that I can work in this creative field of software development, where I can solve problems. I am also an avid cyclist :) and I love to learn...a lot!
Related Posts
  • All
  • By Author
  • By Category
  • By Tag

Leave a Reply