selfup / exdaas

RESTful Elixir Database as a Service! Fault Tolerant, Self Sharding, Self Caching, Single Table, Persistent Key Value Store :tada:
MIT License
9 stars 1 forks source link

Build a Go/Phoenix/Node (with pm2) proxy to mitigate backpressure #6

Open selfup opened 6 years ago

selfup commented 6 years ago

Essentially the logic these nodes go through, while still internally load balanced, and very fast; we need to relieve backpressure via a frontend node that load balances.

So essentially we can either build it in Go which is stupid fast at getting requests, or we can build it in Phoenix but have very little to no logic, which should in theory be fast.

Going to build a small service in Phoenix, otherwise use https://github.com/selfup/gocrashttp or Node.js with pm2 to mutlithread

selfup commented 6 years ago

pm2_express_boilerplate and max clustering: 25k req/s (50k reqs - 300 concurrency) Alpine Container

selfup commented 6 years ago

26.5k req/s with gocrashttp (50k reqs - 300 concurrency) Alpine Container

selfup commented 6 years ago

all of these benchmarks are on the same 2 physical/4 logical core 4th gen mobile i7 from 2013

While pm2/express and Go are comparable in terms of req/s, Node has much slower response times

Go on the other hand has very low response times considering the heavy load and slightly better backpressure management (over Node)

Phoenix is still at half speed but only a 30% increase in response times compared to Go

Distributing the ExDass nodes still makes sense.

But which owl needs to be drawn?

  1. OTP Distributed?
  2. Load balancing delegator?