6 ms·
Benchmarking Go vs. Node vs. Elixir
- rekoros 8y agoSurprising that BEAM is such a CPU hog!
- toast0 8y agoBEAM has some heuristics where it can switch to a busy wait in some cases in an attempt to reduce latency. This is tunable with the +sbwt argument to erl; but the default means it's hard to use the system CPU % as a load indicator.
- brightball 8y agoIt would be interesting to hear more about this because with CPU spiking like that I would have expected more variability in the response time...but quite the opposite it was the most consistent which is one of the big things that the BEAM aims for. I wonder if somebody who's more of an expert on the BEAM could chime into why that might be. More activity in the scheduler maybe?
- gyrgtyn 8y agoWonder how much the anonymous function in the node handler affected it. Not sure what `body` not having `var` in front (so it gets put on global) would do either.
- someguy101010 8y agoTldr?
- hactually 8y agoNode bad, Elixir good but spikey on the CPU, Go best.
- turbo_fart_box 8y agoGod's work. Thanks
- turbo_fart_box 8y agoI would love some sort of bot that I could point at blog posts that could summarize articles with the exact language you used.
- Madeindjs 8y agoI read article and I saw that Node is not so bad at all..
- Juliennng 8y agoIt seems 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
- markus_v 8y agoNot sure but it kind of seems like they are running only one (single-threaded) Node process on multicore CPUs.
- wiennat 8y agoThis immediately comes into my mind when I see the charts. It is also interesting to see that only one Node process can barely serve 10k connections. ---- After I check the source at [0]. They use a simple http module to serve the requests while they use `http.ListenAndServe` which spawns go routines, hence more CPU utilization. [0] https://gitlab.com/stressgrid/dummies https://gitlab.com/stressgrid/dummies
- kt315_ 8y agoAuthor here. Planning to run the same test using cluster module with one worker per CPU. What would be the most performant way to serve HTTP in Go?
- trp1 8y agoWell I believe few people use the built in http module in go. Not sure if you're testing would allow for 3rd party frameworks but the Iris framework loves to claim fastest go web server. Gorilla or gin are also popular. As for the structure of it you would like have everything split out into goroutines with a worker pool of goroutines ready to ferry the data from request to backend and back to client.
- schrodinger 8y agoWhy would you not use the standard library’s http package. I would!
- fileeditview 8y agoThere are so many options to choose from. But don't use Iris. See https://www.reddit.com/r/golang/comments/57w79c/why_you_really_should_stop_using_iris/ https://www.reddit.com/r/golang/comments/57w79c/why_you_real...
- therockhead 8y agoWould be interesting to compare with Java.
- johnisgood 8y agoSlightly off-topic, but: I love those graphs. Any ideas how they created them, or what they are using?
- crave_ 8y agoPossibly using ggplot2: http://www.cookbook-r.com/Graphs/Plotting_means_and_error_bars_(ggplot2)/ http://www.cookbook-r.com/Graphs/Plotting_means_and_error_ba...
- supermatt 8y agoId like to see metrics on memory consumption - is this something you could add?