╔═╗───────╔═══╗╔═══╗
║╬╠╗╔═╗╔╦╗║╔═╗║║╔═╗║
║╔╣╚╣╬╚╣║║╚╝╔╝╠╣╚═╝║
╚╝╚═╩══╬╗║╔═╝╔╩╣╔═╗║
───────╚═╝║ ╚╗║╚═╝║
Evaluation of Play 2.8 API and performance using Wrk 2.
This project provides examples how to test simplest request and configure server side for better response times and minimal CPU usage.
Please, do not go further until you take a pill.
sbt clean stage
sed -i -e 's/1.6/1/g' ./target/universal/stage/bin/play
- Corretto 8:
export JAVA_HOME=/usr/lib/jvm/corretto-8
export JAVA_OPTS="-server -Xms2g -Xmx2g -XX:NewSize=1g -XX:MaxNewSize=1g -XX:+UseParallelGC -XX:-UseBiasedLocking -XX:+AlwaysPreTouch"
./target/universal/stage/bin/play
- OpenJDK 16:
export JAVA_HOME=/usr/lib/jvm/openjdk-16
export JAVA_OPTS="-server -Xms2g -Xmx2g -XX:NewSize=1g -XX:MaxNewSize=1g -XX:+UseParallelGC -XX:-UseBiasedLocking -XX:+AlwaysPreTouch"
./target/universal/stage/bin/play
- OpenJDK 16 + Graal:
export JAVA_HOME=/usr/lib/jvm/openjdk-16
export JAVA_OPTS="-server -Xms2g -Xmx2g -XX:NewSize=1g -XX:MaxNewSize=1g -XX:+UseParallelGC -XX:-UseBiasedLocking -XX:+AlwaysPreTouch -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler"
./target/universal/stage/bin/play
- GraalVM CE Java 8:
export JAVA_HOME=/usr/lib/jvm/graalvm-ce-java8
export JAVA_OPTS="-server -Xms2g -Xmx2g -XX:NewSize=1g -XX:MaxNewSize=1g -XX:+UseParallelGC -XX:-UseBiasedLocking -XX:+AlwaysPreTouch"
./target/universal/stage/bin/play
- GraalVM EE Java 11:
export JAVA_HOME=/usr/lib/jvm/graalvm-ee-java11
export JAVA_OPTS="-server -Xms2g -Xmx2g -XX:NewSize=1g -XX:MaxNewSize=1g -XX:+UseParallelGC -XX:-UseBiasedLocking -XX:+AlwaysPreTouch"
./target/universal/stage/bin/play
Server need to be warmed up before to be able handle max request rate. Use option -R
with half of max value for that.
JSON GET:
./wrk -c50 -d1m -t4 -R65000 -L -v http://localhost:9000/json
JSON POST:
./wrk -c50 -d1m -t4 -R30000 -L -v -s src/test/lua/jsonPost.lua http://localhost:9000/json
Plain text GET:
./wrk -c50 -d1m -t4 -R65000 -L -v http://localhost:9000/plaintext
Plain test POST:
./wrk -c50 -d1m -t4 -R30000 -L -v -s src/test/lua/plaintextPost.lua http://localhost:9000/plaintext
Please see results directory for benchmark results using different JDK and GraalVM versions on the following environment: Intel® Core™ i7-7700HQ CPU @ 2.8GHz (max 3.8GHz), RAM 16Gb DDR4-2400, Ubuntu 18.04, latest versions of Oracle JDK 8/10 and GraalVM CE/EE