Simple HTTP load generator with Hyperfoil

Hyperfoil is a microservice-oriented distributed benchmark framework that can be used as a simple load generating tool.

Let’s say you have nothing and want to bombard an endpoint with 1000 simultaneous requests. This is what you need to do if you need to hit: http://localhost:8080/legumes:

Create request file

name: requests
http:
  - host: http://localhost:8080
    sharedConnections: 1000
phases:
- example:
    atOnce:
      users: 1000
      scenario:
      - test:
        - httpRequest:
            GET: /legumes
            sync: true

Create a file with this contents at /somewhere/requests.hf.yaml

Install Hyperfoil

Download latest and extract somewhere: https://github.com/Hyperfoil/Hyperfoil/releases

Run Hyperfoil

This will start the cli where you will execute the next commands:

> bin/cli.sh
...
[hyperfoil]$ start-local

Upload request to Hyperfoil

[hyperfoil@in-vm]$ upload /somewhere/requests.hf.yaml

Run it

[hyperfoil@in-vm]$ run requests

There you have the load…

If you need the benchmarks, you just need to:

[hyperfoil@in-vm]$ stats

You can have multiple request profiles and create really complex scenarios if needed. Some examples are running the benchmarks across multiple machines and multiple microservices at the same time.

Checkout the oficial quickstart and this blogpost series to dive deeper into the tool.

Links:

https://hyperfoil.io/

https://github.com/Hyperfoil

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.