1. 47

  2. 27

    I believe the Elixir CPU usage is due to the way the Erlang VM manages schedulers. A scheduler will literally busy-wait if it thinks there might be more work to do soon, in an effort to improve the responsiveness of the system. See the +sbwt* family of emulator flags at http://erlang.org/doc/man/erl.html.

    The consequence of this is that you must use the tooling provided with Erlang to get a good idea of actual CPU usage of the application. Top and friends make the world look a bit strange.

    Edit: clarified “actual CPU usage” a bit.

    1. 15

      I’m curious about the CPU Usage shown for Elixir. Maybe since it wasn’t otherwise fully utilized, that was BEAM’s busy-waits spinning for a bit?

      1. 11

        Yes, busy waits are the very likely cause of CPU saturation since BEAM was very responsive. I’d need to run the test with microstate accounting enabled VM to confirm this.

        1. 10

          You could do an easy check by running the emulator with “+sbwt none” and see if the saturation disappears.

          (Also, darn, I didn’t see meredith’s question before I posted my other comment.)

          Edit: maybe you would also want to include “+sbwtdcpu none” and “+sbwtdio none”? I’m not sure.

      2. 7

        I’m curious why the cluster module wasn’t used for Node.js? I’m not saying it’s as good as Elixir/Go lang, I just think perhaps the comparison would have been more fair.

        1. 7

          I wasn’t aware of cluster module and agree it should be included—something for the next round of tests!

        2. 3

          Wow, node performed amazingly! A single thread mostly keeping up with multi-threaded alternatives! Just run $(ncpus) per host and the throughput would soar.

          But who runs benchmarks on VMs anyway? Seems like you’d want to run it on real hardware to get numbers you could count on.

          1. 1

            Yes. The next test will include multiple node processes!

            There were several runs each with new target EC2 instance to see if there would be notable difference in the results from getting “noisy neighbors”. All runs were very consistent.

          2. 2

            Is node still single threaded?

            Also, some of the graphs are confusing. The range bars dip below what should be the minimum limit. Sometimes the latency is below the 90ms (100 - 10%) floor. In one graph, go receives a request in negative microseconds.

            1. 3

              Is node still single threaded?

              Yes, Node is still essentially single threaded. (Essentially because you can, as of 11.7, create Worker threads, but it’s nothing like goroutines or BEAM processes)

              1. 1

                Agree. Bars are based on standard error and I added them as both positive and negative, yet they’re likely to reflect mostly positive error from the graphed mean line. What would be the right way to do this?

                1. 2

                  A lot of natural processes actually follow a lognormal distribution, which nicely handles the impossibility of values below zero.

              2. 1

                Would you see a difference if you ran these on Dedicated hosts on AWS?

                1. 1

                  Interesting test would be to run shared vs dedicated with everything else being the same. My guess is the larger is the instance the less would be the advantage of dedicated host.

                2. 1

                  Surprising the three are very similar in these tests (other than node at 100k connections). If scalabilty characteristics are so similar, that removes that entire concern from choosing one of the three stacks. Developer familiarity and deployment ceremony become more prominent considerations.

                  1. 1

                    For most real world use cases you’ll see a huge difference between Go and the other 2. We tested elixir extensively for activity feeds (vs go) and there is a 8-10x difference in performance. It’s not close.

                    It depends on the use case of course.