GithubHelp home page GithubHelp logo

braintelligencepl / spring-web-vs-spring-webflux Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 242 KB

Web vs Webflux. Analyse performance with Gatling.

Home Page: https://jvm-lukas.com/

Scala 11.51% Kotlin 88.49%

spring-web-vs-spring-webflux's Introduction

Spring Web vs Spring Webflux

Analyze performance of spring-boot-web and spring-boot-webflux


๐Ÿฌ product-store: 8000 - slow service

We have some slow service that responds with 200ms delay. Lets assume that this service mimics some service accessed via HTTP. To better utilize hardware we have reactive stack here - webflux.

Run: ./gradlew -p product-store bootRun


๐Ÿ•ฐ spring-boot-web: 8010 - classical web service

Normal blocking web-service that fetches data from product-store.

Run: ./gradlew -p spring-boot-web bootRun


๐Ÿงฌ spring-boot-webflux: 8010 - reactive web service

Non-blocking, reactive web service that fetches data from product-store.

Run ./gradlew -p spring-boot-webflux bootRun


๐ŸŽ Performance Tests

Run ./gradlew -p performance-tests-gatling loadTest -D USERS=XXX -D REQUESTS_PER_USER=XXX



Results ๐Ÿ‘ฉโ€๐Ÿ”ฌ

Tests launched with:

  • MacBook Pro (15-inch, 2017)
  • 2,8 GHz Intel Core i7
  • 16 GB 2133 MHz LPDDR3
  • Radeon Pro 555 2 GB

Web - users at once 2_000. Each of them making 200 requests.

Simple and popular blocking code.

Run: ./gradlew -p performance-tests-gatling loadTest -D USERS=2000 -D REQUESTS_PER_USER=200


Webflux - users at once 2_000. Each of them making 200 requests.

More efficient, less popular and a bit more complex to implement.

Run: ./gradlew -p performance-tests-gatling loadTest -D USERS=2000 -D REQUESTS_PER_USER=200


Web - users at once 4_000. Each of them making 50 requests.

Run: ./gradlew -p performance-tests-gatling loadTest -D USERS=4000 -D REQUESTS_PER_USER=50


Webflux - Users at once 4_000. Each of them making 50 requests.

Run: ./gradlew -p performance-tests-gatling loadTest -D USERS=4000 -D REQUESTS_PER_USER=50


Web - users at once 4_000. Each of them making 100 requests.

Run: ./gradlew -p performance-tests-gatling loadTest -D USERS=4000 -D REQUESTS_PER_USER=100


Webflux - users at once 4_000. Each of them making 100 requests.

Run: ./gradlew -p performance-tests-gatling loadTest -D USERS=4000 -D REQUESTS_PER_USER=100


Summary:

Basically reactive stack performs requests twice that fast.

spring-web-vs-spring-webflux's People

Contributors

braintelligencepl avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Forkers

faelivrinx

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.