Skip to content

gRPC, Thrift, Spring Boot simple server examples and load tests

Notifications You must be signed in to change notification settings

karlonovak/grpc-javacro17

Repository files navigation

####gRPC, Thrift, Spring Boot MVC REST, JAX-WS (CXF) examples and comparison

This repository was made for JavaCro'17 conference session "Putting REST to rest with gRPC" by Karlo Novak (that's me!).

It contains 4 server projects:

  • grpc-javacro

  • thrift-javacro

  • spring-javacro

  • jaxws-javacro

As well as load/stress tests for each of them:

  • gatling-test-javacro-grpc

  • gatling-test-javacro-thrift

  • gatling-test-javacro-springboot

  • gatling-test-javacro-jaxws


####gRPC, Thrift, Spring Boot MVC REST, JAX-WS (CXF) server examples (Java)

Examples show following technologies:

  1. gRPC

  2. Thrift

  3. Spring Boot

  4. JAX-WS, CXF

All server implementations accept simple POJO GreetingRequest as a request, and return GreetingResponse as a response to make the comparison as fair as it can be. Also, client connections are kept alive in all the implementations to make sure each technology in test has the same starting position.


####Load/stress tests (Scala/Gatling)

alt-text

All the tests are implemented with Scala and Gatling.

Custom protocols for gRPC and Thrift are based upon grpc-gatling project

####Test case and environment

  • Hardware: Intel(R) Core(TM) i5-4200M at 2.50GHz (4 threads using HyperThreading), 8GB RAM
  • Technology: gRPC is the main technology under test and it's being compared to Thrift as a most popular RPC/Binary serialization framework. Also, gRPC is being tested against Spring Boot (MVC) as one of the most popular technologies for building Java based HTTP APIs.
  • Test scenario: Each test uses 50 concurrent users which iterate 20.000 times sending a simple POJO GreetingRequest as a request, and return GreetingResponse* as a response. In total, servers process 1.000.000 (1 million) requests.
  • Points of measurement: Throughput in req/s, request-response speed under heavy load in ms

####Test results

GPRC: alt-text

Thrift: alt-text

Spring Boot (MVC REST): alt-text

JAX-WS: alt-text

About

gRPC, Thrift, Spring Boot simple server examples and load tests

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published