Coder Social home page Coder Social logo

async-web-deferredresults's Introduction

  • To run single thread handler:

          ab -k -n 1000 -c 1000 http://localhost:8082/echo/once/?text=1
    
  • To run callable with threadpool workers (note the c added to 'once'):

          ab -k -n 1000 -c 1000 http://localhost:8082/echo/oncec/?text=1
    
  • To run deferred result with a custom threadpool executor (note the d added to 'once'):

          ab -k -n 1000 -c 1000 http://localhost:8082/echo/onced/?text=1
    
  • To run deferred result with disruptor workerpool (note the r added to 'once'):

          ab -k -n 1000 -c 1000 http://localhost:8082/echo/oncer/?text=1
    
  • To start the server, right click the TomcatDriver class, and hit run in intellij

  • You need java8 to run this project

  • You need maven 3

  • You need 2GB of memory for the process

  • The deferredresult implementation doubles the number of threads used by the executor, therefore it does not cope well. I have tested it with its own executor with a lot less threads to handle calls.

  • run a curl on the server before you run ab to allow the spring context to load and the jvm to warm up

  • sometimes the ab command will fail, this is due to the fact that os or jvm are not able to cope with the speed of creating connections. Repeat the command, it should work after few attempts.

  • Note: tomcat has two connectors defined, one of them is the default, the other is NIO enabled, many connections-accepting 8082 ported connector. Use that in your tests to not be limited by the number of connections tomcat is accepting.

  • These are the results I had on a mac with 8 cores:

async-web-deferredresults's People

Contributors

wesamhaboush avatar

Watchers

 avatar  avatar  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.