GithubHelp home page GithubHelp logo

isabella232 / keycloak-performance-scripts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stakater/keycloak-performance-scripts

0.0 0.0 0.0 12 KB

This repository contains all the required scripts to run performance tests against Keycloak

License: Apache License 2.0

Shell 97.13% Lua 2.87%

keycloak-performance-scripts's Introduction

keycloak-performance-scripts

We used three different tools to evaluate the performance behavior of some of the main Keycloak API endpoints. The tools are:

We suggest to use Vegeta although the other tools can provide some metrics that are missing in Vegeta.

Note: you can also find some scripts used to test endpoints, generate reports or to obtain offline tokens.

Run

Hey scripts

It runs a test with 10, 100 and 1000 connections respectively for each of these three iterations. Each requests sets 1, 10 and 1000 concurrent requests for each iteration.

This script runs two benchmark operations:

    1. Test the access token operation
    1. Test the entitlement endpoint

To run this test, you just simply type this command. Note that, you need to update the variables used in this script.

$./hey_scripts/hey_kc_perf.sh

In the following, we show an example of the result of the benchmark that tests the access token:

Getting access token...
10
1 requests done.
2 requests done.
4 requests done.
6 requests done.
8 requests done.
All requests done.

Summary:
  Total:        3.4762 secs
  Slowest:      0.6522 secs
  Fastest:      0.2417 secs
  Average:      0.3475 secs
  Requests/sec: 2.8767
  Total data:   38690 bytes
  Size/request: 3869 bytes

Detailed Report:

        DNS+dialup:
                Average:        0.0207 secs
                Fastest:        0.0000 secs
                Slowest:        0.2067 secs

        DNS-lookup:
                Average:        0.0098 secs
                Fastest:        0.0000 secs
                Slowest:        0.0978 secs

        Request Write:
                Average:        0.0001 secs
                Fastest:        0.0000 secs
                Slowest:        0.0002 secs

        Response Wait:
                Average:        0.3267 secs
                Fastest:        0.2414 secs
                Slowest:        0.6521 secs

        Response Read:
                Average:        0.0001 secs
                Fastest:        0.0001 secs

Vegeta scripts

To run this test, you just simply type this command. Note that, you need to update the variables used in this script.

$./vegeta_scripts/vegeta_kc_perf.sh

This script runs four internal benchmarks:

    1. Test the user info endpoint
    1. Test the github token
    1. Test to refresh the access token
    1. Test the entitlement endpoint

These benchmarks are configured to run benchmarks with a rate of 250, 300, 350, 400, 450 and 500 requests per second. Consequently, each benchmark runs 6 iterations during a maximum of 120 seconds for each iteration.

Note that, these benchmarks run with a 300 seconds sleep time in between them to cool down the targeted keycloak instance. Moreover, this test uses two files targets and body.json to perform the bencharks. These files are automatically updated to target a different API endpoint with a specific body request.

In the vegeta directory, there is a script that creates reports out of the .bin files that vegeta generates for each iteration. To run, these files has to be located in the same directory where this script lives.

Requests      [total, rate]            300, 10.03
Duration      [total, attack, wait]    30.032670403s, 29.899999694s, 132.670709ms
Latencies     [mean, 50, 95, 99, max]  135.253703ms, 120.603945ms, 215.038853ms, 406.047471ms, 700.119535ms
Bytes In      [total, mean]            476400, 1588.00
Bytes Out     [total, mean]            15000, 50.00
Success       [ratio]                  100.00%
Status Codes  [code:count]             200:300
Error Set:

Wrk scripts

To run this test, you just simply type this command. Note that, you need to update the variables used in this script.

$./wrk_scripts/wrk-kc-test.sh

This script runs two benchmarks:

    1. Test the access token operation. The access token test runs 10 concurrent connections with 1 thread during 10 seconds.
    1. Test the entitlement endpoint. The entitlement test runs 400 concurrent connections with 12 threads during 60 seconds.

keycloak-performance-scripts's People

Contributors

alexeykazakov avatar hectorj2f avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.