Giter VIP home page Giter VIP logo

http_accumulator's Introduction

http_accumulator

Acts as a proxy that accumulates many small http requests into a smaller number of batch requests

Example

Supose you have a microservice server that serves a user's age given their ids:

normal client server

You can deploy accumulator in between so that the server recieves a smaller of number of batch requests

client accumulator server

This can improve performance in some cases.

In those cases the Accumulator is a helpful way of having the batch control at the server side instead of leaving it to the clients.

Testing it

docker-compose up will raise the test stack which consists of:

  • accumulator at port 9992
  • doubler server at port 9991 (a simple server that doubles numbers for you)

Send requests to our demo 'doubler' server at curl localhost:9991 --data 12 --data 10 to see it in action.

Now, use the accumulator to consolidate singular requests into larger batches

for i in `seq 10`; do curl localhost:9992 --data $i > /tmp/testing_$i & done
cat /tmp/testing_*

The accumulator will wait and hold connections until there are N accumulated requests or T time has passed since the first request and finally send everything to the underlying server. It will then de-multiplex responses and send the correct one to each client

http_accumulator's People

Contributors

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