From af83007d1fd2f906a8aefa3e7c33a1de1f471437 Mon Sep 17 00:00:00 2001
From: Valera V Harseko <vharseko@3a-systems.ru>
Date: Mon, 22 Jun 2026 13:26:17 +0000
Subject: [PATCH] Benchmark: lighter default load, log-scale latency, per-server log artifacts

---
 .github/benchmark/summary.sh    |    7 ++++---
 .github/benchmark/benchmark.jmx |    4 ++--
 .github/workflows/benchmark.yml |   45 ++++++++++++++++++++++++++++++++++-----------
 3 files changed, 40 insertions(+), 16 deletions(-)

diff --git a/.github/benchmark/benchmark.jmx b/.github/benchmark/benchmark.jmx
index 07aed73..4abe3c1 100644
--- a/.github/benchmark/benchmark.jmx
+++ b/.github/benchmark/benchmark.jmx
@@ -33,10 +33,10 @@
           <boolProp name="LoopController.continue_forever">false</boolProp>
           <stringProp name="LoopController.loops">-1</stringProp>
         </elementProp>
-        <stringProp name="ThreadGroup.num_threads">${__P(threads,256)}</stringProp>
+        <stringProp name="ThreadGroup.num_threads">${__P(threads,128)}</stringProp>
         <stringProp name="ThreadGroup.ramp_time">${__P(rampup,0)}</stringProp>
         <boolProp name="ThreadGroup.scheduler">true</boolProp>
-        <stringProp name="ThreadGroup.duration">${__P(duration,600)}</stringProp>
+        <stringProp name="ThreadGroup.duration">${__P(duration,300)}</stringProp>
         <stringProp name="ThreadGroup.delay"></stringProp>
       </ThreadGroup>
       <hashTree>
diff --git a/.github/benchmark/summary.sh b/.github/benchmark/summary.sh
index 6b5cbd8..6d233b5 100644
--- a/.github/benchmark/summary.sh
+++ b/.github/benchmark/summary.sh
@@ -115,11 +115,12 @@
 echo ""
 
 # ---------------------------------------------------------------- Latency chart (grouped bars)
-echo "### Mean latency per operation (ms, lower is better)"
+echo "### Mean latency per operation (ms, log scale โ€” lower is better)"
 echo ""
-echo "_๐ŸŸฆ OpenLDAP ยท ๐ŸŸง OpenDJ โ€” grouped bars per operation._"
+echo "_๐ŸŸฆ OpenLDAP ยท ๐ŸŸง OpenDJ โ€” grouped bars per operation. Y axis is logarithmic so the small"
+echo "values stay visible next to the large ones._"
 echo ""
-LAT_CFG="{\"type\":\"bar\",\"data\":{\"labels\":$(labels_json),\"datasets\":[{\"label\":\"OpenLDAP\",\"backgroundColor\":\"$OL_COLOR\",\"data\":[$(vals m "$OL_JSON" meanResTime)]},{\"label\":\"OpenDJ\",\"backgroundColor\":\"$DJ_COLOR\",\"data\":[$(vals m "$DJ_JSON" meanResTime)]}]},\"options\":{\"title\":{\"display\":true,\"text\":\"Mean latency per operation (ms)\"}}}"
+LAT_CFG="{\"type\":\"bar\",\"data\":{\"labels\":$(labels_json),\"datasets\":[{\"label\":\"OpenLDAP\",\"backgroundColor\":\"$OL_COLOR\",\"data\":[$(vals m "$OL_JSON" meanResTime)]},{\"label\":\"OpenDJ\",\"backgroundColor\":\"$DJ_COLOR\",\"data\":[$(vals m "$DJ_JSON" meanResTime)]}]},\"options\":{\"title\":{\"display\":true,\"text\":\"Mean latency per operation (ms, log scale)\"},\"scales\":{\"yAxes\":[{\"type\":\"logarithmic\"}]}}}"
 echo "![Mean latency per operation (ms)]($(qc 900 400 "$LAT_CFG"))"
 echo ""
 
diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml
index d01d019..9c28571 100644
--- a/.github/workflows/benchmark.yml
+++ b/.github/workflows/benchmark.yml
@@ -31,10 +31,10 @@
         default: "openidentityplatform/opendj:latest"
       threads:
         description: "Concurrent JMeter threads"
-        default: "256"
+        default: "128"
       duration:
         description: "Test duration per server (seconds)"
-        default: "600"
+        default: "300"
       rampup:
         description: "Ramp-up period (seconds)"
         default: "0"
@@ -65,8 +65,8 @@
       # `${{ inputs.X || 'default' }}` so workflow_run (which carries no inputs) falls back.
       OPENLDAP_IMAGE: ${{ inputs.openldap_image || 'osixia/openldap:latest' }}
       OPENDJ_IMAGE: ${{ inputs.opendj_image || 'openidentityplatform/opendj:latest' }}
-      THREADS: ${{ inputs.threads || '256' }}
-      DURATION: ${{ inputs.duration || '600' }}
+      THREADS: ${{ inputs.threads || '128' }}
+      DURATION: ${{ inputs.duration || '300' }}
       RAMPUP: ${{ inputs.rampup || '0' }}
       JMETER: ${{ inputs.jmeter_version || '5.6.3' }}
       BENCHPW: benchPass1
@@ -159,8 +159,13 @@
             -l openldap.jtl -e -o openldap
 
       - name: Stop OpenLDAP
+        if: always()
         run: |
-          docker logs openldap 2>&1 | tail -n 100 || true
+          mkdir -p logs/openldap
+          docker logs openldap > logs/openldap/server.log 2>&1 || true
+          # osixia mostly logs to stdout (captured above); grab the in-container /var/log too.
+          docker cp openldap:/var/log logs/openldap/var-log 2>/dev/null || true
+          tail -n 100 logs/openldap/server.log || true
           docker rm -f openldap || true
 
       - name: Start OpenDJ
@@ -220,8 +225,14 @@
             -l opendj.jtl -e -o opendj
 
       - name: Stop OpenDJ
+        if: always()
         run: |
-          docker logs opendj 2>&1 | tail -n 100 || true
+          mkdir -p logs/opendj
+          docker logs opendj > logs/opendj/server.log 2>&1 || true
+          # OpenDJ's internal log directory (errors, access, replication, server.out, ...).
+          docker cp opendj:/opt/opendj/data/logs logs/opendj/internal 2>/dev/null \
+            || docker cp opendj:/opt/opendj/logs logs/opendj/internal 2>/dev/null || true
+          tail -n 100 logs/opendj/server.log || true
           docker rm -f opendj || true
 
       # ---------------------------------------------------------------- Report
@@ -242,10 +253,22 @@
             opendj/
             *.jtl
           if-no-files-found: warn
+          retention-days: 90
 
-      - name: Container logs + cleanup
+      - name: Upload OpenLDAP logs
         if: always()
-        run: |
-          docker logs openldap 2>&1 | tail -n 100 || true
-          docker logs opendj 2>&1 | tail -n 100 || true
-          docker rm -f openldap opendj || true
+        uses: actions/upload-artifact@v7
+        with:
+          name: logs-openldap
+          path: logs/openldap/
+          if-no-files-found: warn
+          retention-days: 90
+
+      - name: Upload OpenDJ logs
+        if: always()
+        uses: actions/upload-artifact@v7
+        with:
+          name: logs-opendj
+          path: logs/opendj/
+          if-no-files-found: warn
+          retention-days: 90

--
Gitblit v1.10.0