Add shenandoah-jdk28: generational vs SATB Shenandoah, G1 and ZGC on a Spring Boot service (JEP 535 status probe included)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HmvoHH3ZnCEaPNXRpDxDZe
This commit is contained in:
Executable
+35
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
# One benchmark run: start the server with the given JVM flags, warm up, measure at a fixed request rate
|
||||
# (latency), then measure peak throughput, and print ONE result line.
|
||||
#
|
||||
# bench-one.sh <java-home> <label> <rep> [jvm flags...]
|
||||
#
|
||||
# Env: RATE (default 3000 req/s), WARMUP (30 s), MEASURE (60 s), PORT (18090)
|
||||
set -u
|
||||
JH=$1; LABEL=$2; REP=$3; shift 3
|
||||
HERE="$(cd "$(dirname "$0")" && pwd)"
|
||||
JAR="$HERE/../target/shenandoah-jdk28-1.0.0.jar"
|
||||
RATE=${RATE:-3000}; WARMUP=${WARMUP:-30}; MEASURE=${MEASURE:-60}; PORT=${PORT:-18090}
|
||||
OUT="$HERE/../target/gclogs"; mkdir -p "$OUT"
|
||||
LOG="$OUT/$LABEL-$REP.log"
|
||||
|
||||
env -u JAVA_TOOL_OPTIONS "$JH/bin/java" -Xms1g -Xmx1g "$@" \
|
||||
-Xlog:gc*:file="$LOG":time,uptime \
|
||||
-jar "$JAR" --server.port=$PORT --spring.main.banner-mode=off --logging.level.root=WARN >/dev/null 2>&1 &
|
||||
PID=$!
|
||||
for _ in $(seq 1 200); do
|
||||
curl -s -o /dev/null -m 1 "localhost:$PORT/work" && break
|
||||
kill -0 $PID 2>/dev/null || { echo "label=$LABEL rep=$REP FAILED: JVM exited"; exit 1; }
|
||||
sleep 0.3
|
||||
done
|
||||
|
||||
OPEN=$(env -u JAVA_TOOL_OPTIONS "$JH/bin/java" "$HERE/LoadGen.java" open "http://localhost:$PORT/work" "$RATE" 64 "$WARMUP" "$MEASURE")
|
||||
CLOSED=$(env -u JAVA_TOOL_OPTIONS "$JH/bin/java" "$HERE/LoadGen.java" closed "http://localhost:$PORT/work" 0 16 10 20)
|
||||
RSS_PEAK_MB=$(awk '/VmHWM/ {printf "%d", $2/1024}' /proc/$PID/status)
|
||||
COMMITTED=$(curl -s "localhost:$PORT/info" | sed -n 's/.*"committedMiB":\([0-9]*\).*/\1/p')
|
||||
kill $PID 2>/dev/null; wait $PID 2>/dev/null
|
||||
|
||||
W0=$(sed -n 's/.*window_start_ms=\([0-9]*\).*/\1/p' <<<"$OPEN"); W1=$(sed -n 's/.*window_end_ms=\([0-9]*\).*/\1/p' <<<"$OPEN")
|
||||
PAUSES=$(python3 "$HERE/gc_pauses.py" "$LOG" "$W0" "$W1")
|
||||
CLOSED_TPUT=$(sed -n 's/.*achieved=\([0-9.]*\).*/\1/p' <<<"$CLOSED")
|
||||
echo "label=$LABEL rep=$REP $(sed 's/ window_start_ms=.*//; s/^mode=open //' <<<"$OPEN") peak_rps=$CLOSED_TPUT $PAUSES rss_peak_mb=$RSS_PEAK_MB heap_committed_mb=$COMMITTED"
|
||||
Reference in New Issue
Block a user