Demonstrates a load test with Spring Boot 2
Switch branches/tags
Nothing to show
Clone or download
Latest commit d998ee0 Jun 8, 2018

README.adoc

Spring Boot2 Performance Harness

This is a sample Spring Boot 2 app to demonstrate the raw performance difference between a Spring Boot 2 app vs a Spring Boot 1 app.

Backing Service

./gradlew -p applications/sample-load-target clean bootRun

Spring Boot 2 based app:

Run the Spring Boot 2 based app:

./gradlew -p applications/boot2-load-sample clean bootRun

Call target endpoint

Assuming that httpie is installed

http POST 'http://localhost:8082/passthrough/messages' id="1" payload="one"   delay="1000"

OR with CURL

curl -X "POST" "http://localhost:8082/passthrough/messages" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -d $'{
  "id": "1",
  "payload": "one",
  "delay": "1000"
}'

Spring Boot 1 based app:

Run the Spring Boot 1 based app:

./gradlew -p applications/boot1-load-sample clean bootRun

Call target endpoint

Assuming that httpie is installed

http POST 'http://localhost:8081/passthrough/messages' id="1" payload="one"   delay="1000"

OR with CURL

curl -X "POST" "http://localhost:8081/passthrough/messages" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -d $'{
  "id": "1",
  "payload": "one",
  "delay": "1000"
}'

Spring Cloud Gateway based app:

Run the app:

./gradlew -p applications/spring-cloud-gateway-sample clean bootRun

Call target endpoint

Assuming that httpie is installed

http POST 'http://localhost:8083/passthrough/messages' id="1" payload="one"   delay="1000"

OR with CURL

curl -X "POST" "http://localhost:8083/passthrough/messages" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -d $'{
  "id": "1",
  "payload": "one",
  "delay": "1000"
}'

Spring Cloud Zuul based app:

Run the app:

./gradlew -p applications/zuul-sample clean bootRun

Call target endpoint

Assuming that httpie is installed

http POST 'http://localhost:8084/passthrough/messages' id="1" payload="one"   delay="1000"

OR with CURL

curl -X "POST" "http://localhost:8084/passthrough/messages" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -d $'{
  "id": "1",
  "payload": "one",
  "delay": "1000"
}'

Zuul2 based app:

Run the app:

./gradlew -p applications/zuul2-sample clean run

Call target endpoint

Assuming that httpie is installed

http POST 'http://localhost:8085/passthrough/messages' id="1" payload="one"   delay="1000"

OR with CURL

curl -X "POST" "http://localhost:8085/passthrough/messages" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -d $'{
  "id": "1",
  "payload": "one",
  "delay": "1000"
}'

Run Load tests

Against Boot 2 version of the app

./gradlew -p applications/load-scripts  -DTARGET_URL=http://localhost:8082 -DSIM_USERS=300 gatlingRun

Against Boot 1 version of the app

./gradlew -p applications/load-scripts  -DTARGET_URL=http://localhost:8081 -DSIM_USERS=300 gatlingRun

Against Spring Cloud Gateway version of the app

./gradlew -p applications/load-scripts  -DTARGET_URL=http://localhost:8083 -DSIM_USERS=300 gatlingRun

Against Spring Cloud Zuul version of the app

./gradlew -p applications/load-scripts  -DTARGET_URL=http://localhost:8084 -DSIM_USERS=300 gatlingRun

Against Zuul2 version of the app

./gradlew -p applications/load-scripts  -DTARGET_URL=http://localhost:8085 -DSIM_USERS=300 gatlingRun