Pro

Benchmarks

It beats frameworks really badly. Don't think this is the main feature of Pro. It's just a side effect

Machine

My laptop specs: i7 2.20GHz × 8 16GB RAM running Ubuntu.

Method

I run 20k requests from a single client. Each request has to wait for one second and reply with a string. Waiting simulates non-blocking I/O operation.

  def perform(data)
    sleep(1)
    reply sid: data['sid'], data: "benchmarked!"
  end

I need some help with testing multiple clients though. Odin seems to be the right tool but it fails so far.

Results

To have all requests finished Pro needs 23 seconds which gives 870 req/s.

Further investigation shows that first bottleneck is in websocket throughput. Testing only this part yields 1000 req/s.

Testing another part of Pro stack gives stunning 6000 req/s using around 35% CPUs. This time the bottleneck was the message bus.

Comparison

Let's compare to Rails which is the most popular framework I know. Because of single client and a fact that we need to wait for response before another request this benchmark would take more than 5.5h considering only sleeping part. You could say that we should use background job but we can't reply with it. With multiple clients on 16 instances it takes 4018 seconds (over an hour) which gives less than 5 req/s.

If for some reason you need your old framework, you can run it as a consumer.

Possible improvements

It's hard to say if multiple clients benchmark will show higher throughput. But for sure primus can be scaled with more instances. We have 7 more cores to employ on this machine.

Having more disque instances is as easy as having one.

CONTACT ME AT MAD@MANIAK.PRO. I NEED YOUR QUESTIONS.