Coder Social home page Coder Social logo

springfluxvsmvc's Introduction

Description

This project consists of Spring MVC and Flux services and can be used to showcase the limitations of thread-per-request model.
Both services return random numbers, with a 2 seconds delay to simulate request processing.
In addition, this project shows how to set up Gradle multi-project build.

How to Run

  1. Run the MVC service: ./gradlew :mvc:bootRun
  2. Make 1000 concurrent requests to the MVC service: artillery quick --count 1000 -n 1 http://localhost:8090/api/random
  3. Run the Flux service: ./gradlew :flux:bootRun
  4. Make 1000 concurrent requests to the Flux service: artillery quick --count 1000 -n 1 http://localhost:8091/api/random
  5. Run the MVC with virtual threads service: ./gradlew :mvc-virtual:bootRun
  6. Make 1000 concurrent requests to the MVC with virtual threads service: artillery quick --count 1000 -n 1 http://localhost:8092/api/random

Results and Conclusions

The p99 response time for the MVC service should be around 10 seconds, but for the Flux service this value would be around 2 seconds.
This situation happens because of thread starvation, MVC service runs out of available threads in the thread pool.
Flux service on the other hand doesn't have this issue, since it uses an event loop for requests processing.

springfluxvsmvc's People

Contributors

martishin avatar

Watchers

 avatar

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.