Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ scripts/stress.sh quarkus3-spring-compatibility/target/quarkus-app/quarkus-run.j
scripts/stress.sh springboot3/target/springboot3.jar
```

Alternatively, you can run the whole set by running:

```shell
./scripts/stress-all.sh
```

For each test, you should see output like

```shell
Expand Down
51 changes: 51 additions & 0 deletions scripts/stress-all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash

thisdir=`dirname "$0"`
set -euo pipefail

${thisdir}/infra.sh -s

killApp () {
(lsof -t -i:8080 || true) | xargs -r kill
}

wait_for_8080() {
echo "Waiting for port 8080..."
for ((i=0; i<30; i++)); do
# Using 127.0.0.1 is safer than localhost on macOS to avoid IPv6 ::1 mismatch
if (echo > /dev/tcp/127.0.0.1/8080) >/dev/null 2>&1; then
return 0
fi
sleep 1
done
echo "Timeout waiting for port 8080"
return 1
}
Comment on lines +12 to +23
Copy link
Member Author

@Sanne Sanne Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@quintesse have a look also at this script, could be useful for your own; this one waits just enough for the frameworks to have opened port 8080. Seems like a good replacement for the "10 seconds" rule.

Also, you could then use the total time of the benchmark - including boostrap times - as a fair comparison.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Delawen as well FYI


launchJar() {
java -XX:ActiveProcessorCount=4 -Xms512m -Xmx512m -jar $1 &
}

bench () {
echo "Now running $2" >> $REPORTNAME
killApp
echo "Booting: $2"
launchJar ${thisdir}/../$1
wait_for_8080
echo "Starting Benchmark, please wait... "
jbang wrk@hyperfoil -t2 -c100 -d20s --timeout 1s http://localhost:8080/fruits >> $REPORTNAME
echo "" >> $REPORTNAME
killApp
}

timestamp=$(date +"%Y-%m-%d_%H-%M-%S")
REPORTNAME="report_${timestamp}.txt"

echo "Collecting summary in report file $REPORTNAME"
bench "quarkus3/target/quarkus-app/quarkus-run.jar" "Quarkus"
bench "quarkus3-spring-compatibility/target/quarkus-app/quarkus-run.jar" "Quarkus, with Spring compatibility"
bench "springboot3/target/springboot3.jar" "Spring Boot"

${thisdir}/infra.sh -d

cat $REPORTNAME
19 changes: 16 additions & 3 deletions scripts/stress.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
#!/bin/bash

thisdir=`dirname "$0"`
set -euo pipefail

# make sure the port is clear before enabling halting-on-error
kill $(lsof -t -i:8080) &>/dev/null
# Kills any process running on 8080, but avoids erroring out if there is none
(lsof -t -i:8080 || true) | xargs -r kill

set -euo pipefail
wait_for_8080() {
echo "Waiting for port 8080..."
for ((i=0; i<30; i++)); do
# Using 127.0.0.1 is safer than localhost on macOS to avoid IPv6 ::1 mismatch
if (echo > /dev/tcp/127.0.0.1/8080) >/dev/null 2>&1; then
return 0
fi
sleep 1
done
echo "Timeout waiting for port 8080"
return 1
}

${thisdir}/infra.sh -s
java -XX:ActiveProcessorCount=4 -Xms512m -Xmx512m -jar ${thisdir}/../$1 &
wait_for_8080
jbang wrk@hyperfoil -t2 -c100 -d20s --timeout 1s http://localhost:8080/fruits
${thisdir}/infra.sh -d
kill $(lsof -t -i:8080) &>/dev/null
Loading