Giter Club home page Giter Club logo

sample-spring-boot-netty's Introduction

Spring Boot + Netty

Description

The repository is a high-performance tech stack based on Spring Boot that using Netty instead of Spring Web MVC / Spring Webflux.

Performance Comparison

Environment

KVM, Ubuntu 16.04, 2048 MB RAM, 2 CPU

Run: $ java -Xmx1024M -server -jar application.jar

Test: $ wrk -t12 -c400 -d30s --latency http://host/api/user/current

Tomcat

Running 30s test @ http://host/api/user/current
  12 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    54.66ms   64.39ms 996.17ms   92.02%
    Req/Sec   744.51    140.25     3.08k    85.77%
  Latency Distribution
     50%   42.26ms
     75%   65.72ms
     90%  105.89ms
     99%  275.51ms
  265240 requests in 30.06s, 53.93MB read
Requests/sec:   8822.80
Transfer/sec:      1.79MB

Undertow

Running 30s test @ http://host/api/user/current
  12 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    66.80ms  121.30ms   1.94s    91.37%
    Req/Sec     0.87k   327.28     6.07k    91.60%
  Latency Distribution
     50%   27.18ms
     75%   77.43ms
     90%  172.98ms
     99%  505.67ms
  303177 requests in 30.04s, 51.47MB read
  Socket errors: connect 0, read 0, write 0, timeout 148
Requests/sec:  10090.98
Transfer/sec:      1.71MB

Spring Reactive - Webflux

Running 30s test @ http://host/api/user/current
  12 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    64.22ms  101.43ms   2.00s    89.74%
    Req/Sec     0.88k   332.80     7.93k    93.13%
  Latency Distribution
     50%   27.41ms
     75%   77.47ms
     90%  168.43ms
     99%  432.62ms
  306800 requests in 30.10s, 52.08MB read
  Socket errors: connect 0, read 0, write 0, timeout 36
Requests/sec:  10193.27
Transfer/sec:      1.73MB

This

Running 30s test @ http://host/api/user/current
  12 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    25.38ms   41.24ms 460.39ms   90.51%
    Req/Sec     2.38k   325.27     4.46k    88.33%
  Latency Distribution
     50%   12.09ms
     75%   18.72ms
     90%   63.93ms
     99%  215.51ms
  845952 requests in 30.05s, 129.08MB read
Requests/sec:  28151.60
Transfer/sec:      4.30MB

Overview

Diagram

So, this stack in 2.8 times faster than Undertow and Webflux and in 3.18 times faster than Tomcat.

The difference in rates becomes higher with more performance hardware.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.