Nebo15 / annon.api

Configurable API gateway that acts as a reverse proxy with a plugin system.
http://docs.annon.apiary.io/
MIT License
331 stars 25 forks source link

Asynchronously stream requests to upstream when possible [feature] #251

Closed AndrewDryga closed 7 years ago

AndrewDryga commented 7 years ago

Old implementation did buffering for any data that comes in and out of the gateway, which produce several drawbacks:

  1. Memory usage was high
  2. Network I/O had many peaks (read full body and then send it to upstream)
  3. Higher latency (now upstream accepts connection almost instantly)
  4. It was impossible to send large files, because they consumed lots of memory on gateway side.

Current implementation will buffer only requests with application/json content-type, allowing Logger to save them.

Future plans:

AndrewDryga commented 7 years ago

Ebert has finished reviewing this Pull Request and has found:

But beware that this branch is 4 commits behind the Nebo15:master branch, and a review of an up to date branch would produce more accurate results.

You can see more details about this review at https://ebertapp.io/github/Nebo15/annon.api/pulls/251.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.3%) to 91.124% when pulling b27935813356d482bf26a2f88f8875f7ffe7875a on async_requests into 754fda8e943e2348c0b2cc9a521c8436722f8816 on master.