Skip to content

arcadius/java-rest-api-web-container-benchmark

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

java-rest-api-web-container-benchmark

Are you wondering which web container to use for your nest Java REST API?

If your answer is yes, then you are not alone.

This project compares: Tomcat, Jetty, Grizzly and Undertow in term of serving JAX-RS responses

TO avoid any latency, the REST API does not try to access any backend service.

There are 3 blog entries supporting this benchmark:

##Setup To run this benchmark, you will need:

##Running load tests with default server configuration to run the test,

  • first start the API server by doing: ./gradlew -p <SERVER NAME> bootRun where <SERVER NAME> is one of grizzly, jetty, tomcat or undertow

  • then in a new console, do ./run-load-test.sh feel free to edit the script for for different load profile

##Changing server thread pool size and header One can easily change server thread pool size on the command line:

Note that it has been advised (Undertow folk) that we take as worker-thread 16*numberOfCores

In my case, we have 2 cores => workers=32

####Grizzly

./gradlew bootRun -p grizzly -Dserver.grizzly.worker-threads=32 -Dserver.server-header=TestServer

####Jetty

./gradlew bootRun -p jetty -Dserver.jetty.min-threads=32 -Dserver.jetty.max-threads=32 -Dserver.server-header=TestServer

####Tomcat

./gradlew bootRun -p tomcat -Dserver.tomcat.max-threads=32 -Dserver.server-header=TestServer

####Undertow

./gradlew bootRun -p undertow -Dserver.undertow.worker-threads=32 -Dserver.server-header=TestServer

#Actuator To enable spring boot actuator,please look in build.gradle for the comments /**To enable actuator...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published