Skip to content

fugerit-org/fj-doc-quarkus-demo

Repository files navigation

fj-doc-quarkus-demo

Simple demo application to test performances of Fugerit Venus Doc library.

Keep a Changelog v1.1.0 badge license code of conduct Quality Gate Status Coverage Docker images

Java version Apache Maven Fugerit Github Project Conventions

Here you can find quarkus original readme.

Quickstart

After clone, from the project root :

1. Build

mvn clean package

2. Run benchmark script

Benchmark script needs :

  • bash (required)
  • h2load (required)
  • psrecord (optional, if not present plot will be skipped)
./src/main/script/bench-graph-h2-load.sh pdf-fop 1000

The script accepts these positional arguments :

position required default description
1 (HANDLER) true handler id : 'pdf-fop', 'pdf-fop-pool', 'pdf-a-fop', 'pdf-ua-fop' , 'openpdf'
2 (NUMBER_OF_REQUESTS) false 50000 Total number of requests to run (h2load -n)
3 (NUMBER_OF_CLIENTS) false 60 Number of concurrent clients (h2load -c)
4 (NUMBER_OF_THREADS) false 4 Number of concurrent threads (h2load -t)

Currently configured pdf handlers :

It is possible to change doc handlers configuration from the freemarker-doc-process.xml XML configuration.

3. Run and test

mvn quarkus:dev

open http://localhost:8080/doc/pdf/handler/pdf-fop/simple-test-01.pdf

Benchmark suit

This script run benchmark on all doc handlers and write the output to target/ folder.

./src/main/script/bench-graph-h2-load-complete.sh

Here is an example of the files generated by the suite in target/ folder :

out_openpdf.log
out_openpdf.png
out_pdf-fop-pool.log
out_pdf-fop-pool.png
out_pdf-fop.log
out_pdf-fop.png

Below is the example content of the target/out_pdf-fop.log file :

starting benchmark...
spawning thread #0: 15 total client(s). 250 total requests
spawning thread #1: 15 total client(s). 250 total requests
spawning thread #2: 15 total client(s). 250 total requests
spawning thread #3: 15 total client(s). 250 total requests
Application protocol: h2c
progress: 10% done
progress: 20% done
progress: 30% done
progress: 40% done
progress: 50% done
progress: 60% done
progress: 70% done
progress: 80% done
progress: 90% done
progress: 100% done

finished in 779.33ms, 1283.15 req/s, 21.16MB/s
requests: 1000 total, 1000 started, 1000 done, 1000 succeeded, 0 failed, 0 errored, 0 timeout
status codes: 1000 2xx, 0 3xx, 0 4xx, 0 5xx
traffic: 16.49MB (17295040) total, 4.92KB (5040) headers (space savings 91.00%), 16.46MB (17259800) data
                     min         max         mean         sd        +/- sd
time for request:     4.94ms    178.98ms     43.29ms     28.90ms    67.80%
time for connect:       61us       995us       450us       257us    61.67%
time to 1st byte:    13.75ms    104.97ms     36.04ms     19.11ms    85.00%
req/s           :      20.61       32.65       23.25        2.37    81.67%

NOTE: if psrecord is not present, no png will be created.

And here is some samples

fj-doc platform java version pdf-fop pdf-fop-pool openpdf output folder parameters
8.5.0 Macbook pro 16 max M1 32gb (Sonoma 14.5) Oracle GraalVM 21 28.05s, 1782.40 req/s, 29.88MB/s 20.81s, 2402.76 req/s, 40.28MB/s 53.42s, 936.05 req/s, 8.89MB/s 2024-08-03 h2load, 50000 request, 60 clients, 4 threads
8.5.0 AMD Ryzen 3700X 32gb (Ubuntu 22) Oracle GraalVM 21 28.07s, 1781.52 req/s, 29.86MB/s 19.66s, 2543.10 req/s, 42.63MB/s 40.91s, 1222.29 req/s, 11.61MB/s 2024-08-03 h2load, 50000 request, 60 clients, 4 threads
8.5.0 AMD Ryzen 9 3900X (24) @ 3.800GHz 128gb (Fedora 40) OpenJDK Red Hat 21 20.16s, 2479.60 req/s, 41.59MB/s 16.94s, 2951.92 req/s, 49.51MB/s 25.30s, 1976.29 req/s, 18.93MB/s 2024-08-03 h2load, 50000 request, 60 clients, 4 threads
8.5.0 Container, 4 cpu, RHEL, 1200m (on Macbook pro 16 max M1) OpenJDK Red Hat 21 59.89s, 834.83 req/s, 13.98MB/s 41.97s, 1191.39 req/s, 19.95MB/s 92.67s, 539.53 req/s, 5.12MB/s 2024-08-05 h2load, 50000 request, 60 clients, 4 threads

Benchmark with docker

Starting cointainer (default is 1200m and 4 cpu maximu)

docker compose -f src/main/docker/docker-compose.yml up -d

Run benchmark

export NO_START=1;./src/main/script/bench-graph-h2-load-complete.sh

You will need the NO_START=1 environment variable, so quarkus app will not be started by the script