Git Product home page Git Product logo

loomperf's Introduction

Spring+Project Loom sample

This project is a quick app to show how much more "scalability" project loom can provide to a vanilla spring app.

The application is purposefully very simple, but it tries to replicate a common scenario in (micro)services:

an HTTP request comes in, an external service is called and a row is added to a database

This is a scenario that normally can be scaled by tweaking and increasing the thread pool size that server the incoming HTTP requests; on purpose, no defaults were changed in the spring application configuration, only the flag that enables virtual threads (spring.threads.virtual.enabled) - to have a like for like comparison and also .

The external service call has been simulated via MockServer; the external request adds a fixed delay of 500ms to the responses, to simulate on purpose "long" pauses which are common in scenarios where your service has a dependency which has (long)er response times.

A locust script is included to cause load on the system.

Results

The result directory contains, commented, the results of the tests run.

Running

To run locally, you will need:

  • a running MySQL or MariaDB - can be installed locally, or run via docker
  • running the local mockserver - can be run via maven with the command
    • mvn process-test-resources org.mock-server:mockserver-maven-plugin:5.15.0:run
  • running locust - you will need a recent python (3.10+) and install locust as per its documentation
    • the locust script can be run via locust -H http://localhost:8080
  • The application can be run via the usual mvn spring-boot:run
    • ensure the database connection is correct in the spring application config
    • To switch native thread vs virtual thread (loom), change the spring.threads.virtual.enabled config

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.