Skip to content

Commit 27d1ef4

Browse files
committed
performance tests results
1 parent 96d545b commit 27d1ef4

1 file changed

Lines changed: 43 additions & 23 deletions

File tree

README.md

Lines changed: 43 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,37 @@
11
# Ferrum
22

3-
`Ferrum` (`Ferrum Community Authorization Server`) is a **better** Authorization Server, this is a Community version.
3+
`Ferrum` (`Ferrum Community Authorization Server`) is a Authorization Server that is
4+
* :comet:fast,
5+
* :fire:low resource consumption,
6+
* :heavy_check_mark:fully tested including performance testing
47

58
![GitHub go.mod Go version (subdirectory of monorepo)](https://img.shields.io/github/go-mod/go-version/wissance/Ferrum?style=plastic)
69
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/wissance/Ferrum?style=plastic)
710
![GitHub issues](https://img.shields.io/github/issues/wissance/Ferrum?style=plastic)
811
![GitHub Release Date](https://img.shields.io/github/release-date/wissance/Ferrum)
9-
![GitHub release (latest by date)](https://img.shields.io/github/downloads/wissance/Ferrum/v0.9.3.alpha1/total?style=plastic)
12+
![GitHub release (latest by date)](https://img.shields.io/github/downloads/wissance/Ferrum/v0.9.3.rc1/total?style=plastic)
1013
[![Wissance.WebApiToolkit CI](https://github.com/Wissance/Ferrum/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/Wissance/Ferrum/actions/workflows/ci.yml)
1114

1215
![Ferrum: A better Auth Server](/img/ferrum_cover.png)
1316

14-
## 0. Why Ferrum
17+
## 1. Why Ferrum
1518

16-
* :white_check_mark: Simple configuration and start
19+
### 1.1 Main Ferrum advantages:
20+
* :white_check_mark: Simple configuration and start either as a **native app** or an `docker` containerized app;
1721
* :sparkles: `Keycloak-compatible API`
1822
* :boom: Can be **embedded** inside any application or used as a *standalone* application
19-
* :film_strip: Can be simply install absolutely with no dependent services to single board computer with low resources, requires `40-50 Mb` of `RAM` under low load (10-100 users)
20-
* :stars: fast (there are no performance test yet, but they will be written during the `0.9.3` version) with aim to be serving up to `10K users on a single node`.
21-
* :heavy_check_mark: `Ferrum` is widely covered by unit and integration tests every push on `develop` or `master` runs tests and static analyze check with linters.
23+
* :film_strip: Can be simply install absolutely with no dependent services to single board computer with `low resource usage`, requires `40-50 Mb` of `RAM` with up to `100 - 200 users`;
24+
* :stars: *fast* (there are no performance test yet, but they will be written during the `0.9.3` version) with aim to be serving up to `10K users on a single node`, `0.9.3.rc1` `K6` automated performance tests shows **500 users** simultaneous work with `~20ms 99% of requests` with < `130 Mb of RAM` and `2 CPU Cores` usage;
25+
* :heavy_check_mark: `Ferrum` is widely covered by unit and integration tests every push on `develop` or `master` runs tests and static analyze check with `linters`.
2226
* :desktop_computer: `metrics` allow to control all HTTP-requests duration and those part related to data storage access with count three groups by request time - `p50`, `p90` and `p99` also metrics count total amount of requests and errors during requests handling.
2327
* :microscope: during to modular parts and interface usage, `Ferrum` could be used with any type of persistent storage
2428

25-
## 1. Communication
29+
## 2. Communication
2630

2731
* [Discord channel](https://discord.gg/9RYNYu2Mxq)
2832
* [Telegram channel](t.me/ferrum_community_authserver)
2933

30-
## 2. General info
34+
## 3. General info
3135

3236
`Ferrum` is `OpenId-Connect` Authorization server written on GO. It has Data Contract similar to
3337
`Keycloak` server (**minimal `Keycloak`** and we'll grow to full-fledged `KeyCloak` analog).
@@ -54,9 +58,9 @@ it has `endpoints` SIMILAR to `Keycloak`, at present time we are having followin
5458
2. Get UserInfo `GET ~/auth/realms/{realm}/protocol/openid-connect/userinfo`
5559
3. Introspect tokens `POST ~/auth/realms/{realm}/protocol/openid-connect/token/introspect`
5660

57-
## 3. How to use
61+
## 4. How to use
5862

59-
### 3.1 Build
63+
### 4.1 Build
6064

6165
First of all build is simple run `go build` from application root directory. Additionally it is possible
6266
to generate self signed certificates - run `go generate` from command line
@@ -65,7 +69,7 @@ If you don't specify the name of executable (by passing -o {execName} to go buil
6569

6670
For running static analyze check use command `golangci-lint run`
6771

68-
### 3.2 Run application as Standalone
72+
### 4.2 Run application as Standalone
6973

7074
Run is simple (`Ferrum` starts with default config - `config.json`):
7175
```ps1
@@ -78,7 +82,7 @@ To run `Ferrum` with selected config i.e. `config_w_redis.json` :
7882
./Ferrum --config ./config_w_redis.json
7983
```
8084

81-
### 3.3 Run application in docker
85+
### 4.3 Run application in docker
8286

8387
It is possible to start app in docker with already installed `REDIS` and with initial data (see python
8488
data insert script):
@@ -87,7 +91,7 @@ data insert script):
8791
docker-compose up --build
8892
```
8993

90-
### 3.4 Run with direct configuration && data pass from code (embedding Authorization server in you applications)
94+
### 4.4 Run with direct configuration && data pass from code (embedding Authorization server in you applications)
9195

9296
There are 2 ways to use `Ferrum`:
9397
1. Start with config file (described above)
@@ -105,17 +109,33 @@ There are 2 ways to use `Ferrum`:
105109
app.Stop()
106110
```
107111

108-
### Test
112+
### 4.5 Testing
113+
114+
### 4.5.1 Functional testing
115+
109116
At present moment we have 2 fully integration tests, and number of them continues to grow. To run test execute from cmd:
110117
```ps1
111118
go test
112119
```
113120
For running Manager tests on `Redis` you must have redis on `127.0.0.1:6379` with `ferrum_db` / `FeRRuM000` `auth` `user+password`
114121
pair, it is possible to start docker_compose and test on compose `ferrum_db` container
115122

116-
## 4. Configure
123+
### 4.5.2 Performance testing
124+
Perfomance test running automatically with `K6` included in separate [docker-compose](./docker-compose.perf) running with powershell script - `start_docker_perftests.ps1`. `K6` tests itself located in `tools folder` started with prefix `k6`:
125+
* `k6_smoke_test.js` - small load with 10 users with 1 min duration;
126+
* `k6_average_load_test.js` - average load with up to 500 users running ~ `1 hour`
127+
128+
Result of running avg load - 10 ms average response time, `p99` (99% of requests) duration around `20 ms`, maximum RAM usage during this test is `130 Mb` and takes `2 CPU Cores`, see results below:
129+
130+
![Grafana during avg test](/img/additional/ck6_500users_avg_loading.png)
131+
132+
And Summary of result from the K6 window:
133+
![K6 avg load summary](/img/additional/ck6_500users_avg_loading_res.png)
134+
135+
136+
## 5. Configure
117137

118-
### 4.1 Server configuration
138+
### 5.1 Server configuration
119139

120140
Configuration splitted onto several sections:
121141

@@ -135,7 +155,7 @@ Configuration splitted onto several sections:
135155
- key file that is using for `JWT` tokens generation (`access_token` && `refresh_token`),
136156
name `keyfile` (without extensions).
137157

138-
### 4.2 Configure user data as you wish
158+
### 5.2 Configure user data as you wish
139159

140160
Users does not have any specific structure, you could add whatever you want, but for compatibility
141161
with keycloak and for ability to check password minimal user looks like:
@@ -155,7 +175,7 @@ with keycloak and for ability to check password minimal user looks like:
155175
in this minimal user example you could expand `info` structure as you want, `credentials` is a service structure,
156176
there are NO SENSES in modifying it.
157177

158-
### 4.3 Server embedding into application (use from code)
178+
### 5.3 Server embedding into application (use from code)
159179

160180
Minimal full example of how to use coud be found in `application_test.go`, here is a minimal snippet:
161181

@@ -195,11 +215,11 @@ if err != nil {
195215
app.Stop()
196216
```
197217

198-
## 5. Server administer
218+
## 6. Server administer
199219

200220
Since version `0.9.1` it is possible to use `CLI Admin` [See](api/admin/cli/README.md)
201221

202-
### 5.1 Use CLI admin in a docker
222+
### 6.1 Use CLI admin in a docker
203223

204224
1. Run docker compose - `docker compose up --build`
205225
2. List running containers - `docker ps -a`
@@ -208,7 +228,7 @@ Since version `0.9.1` it is possible to use `CLI Admin` [See](api/admin/cli/READ
208228

209229
![Use CLI Admin from docker](/img/additional/cli_from_docker.png)
210230

211-
### 5.2 Observability (SRE)
231+
### 6.2 Observability (SRE)
212232

213233
For checking application state, we could query the `~/metrics` endpoint (i.e., for local instance full `URL` - `http://127.0.0.1/metrics`). But starting with `0.9.3` were added `prometheus` and `grafana` to be running simultaneously with `Ferrum` using `docker-compose`. `Grafana` model could be found [here](/prometheus/grafana_ferrum_dashboard_model.json). It requires only replacing the Prometheus ID.
214234

@@ -224,7 +244,7 @@ For checking application state, we could query the `~/metrics` endpoint (i.e., f
224244
Screenshot with grafana dashboard:
225245
![Grafana dashboard](/img/additional/sre_grafana_example.png)
226246

227-
## 6. Contributors
247+
## 7. Contributors
228248

229249
<a href="https://github.com/Wissance/Ferrum/graphs/contributors">
230250
<img src="https://contrib.rocks/image?repo=Wissance/Ferrum" />

0 commit comments

Comments
 (0)