News for hackers. Stuff that matters.
Re:Benchmarking Go vs. Node vs. Elixir by markus_v on Tuesday February 05, 2019 @07:17PM (#19091467)
Not sure but it kind of seems like they are running only one (single-threaded) Node process on multicore CPUs.
Re:Benchmarking Go vs. Node vs. Elixir by wiennat on Tuesday February 05, 2019 @08:36PM (#19091912)
This 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

Re:Benchmarking Go vs. Node vs. Elixir by HiFaraz on Wednesday February 06, 2019 @12:49AM (#19093020)
It's an unfair comparison then if they don't even use Node.js to its full potential. Apple to oranges comparison.
Re:Benchmarking Go vs. Node vs. Elixir by kt315_ on Tuesday February 05, 2019 @09:59PM (#19092314)
Author 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?

Re:Benchmarking Go vs. Node vs. Elixir by octetcloud on Thursday February 07, 2019 @01:03PM (#19106976)
I'd avoid the cluster module, its not the recommended way to scale Node.js. It exists mostly as a way to make naive Node.js benchmarks perform better in multi-CPU comparison testing... like yours! :-) Many cloud providers charge per-CPU, so node's "mostly not threaded approach" is reasonable, IMO and that of many other users. Node is scaled by spinning up more instances, each instance being one of the cheapest "one CPU" variety. I'd be more interested in seeing a version of your benchmark that limited each of the language instances to a single CPU, and/or that spun up multiple node instances equivalent to one multi-cpu instance of go/elixir --- this latter may sound weird, but its a "cost equivalent" comparison, which is ultimately what's important: transactions served per $$.
Re:Benchmarking Go vs. Node vs. Elixir by kt315_ on Thursday February 07, 2019 @01:32PM (#19107224)
One of the benchmark goals was to test "scheduling" efficiency of each runtime. In other words to show how well it scales given many-core instance, which often is more economical in transaction/$$ sense.

Question: how using cluster module is different from spinning up multiple node instances?

Re:Benchmarking Go vs. Node vs. Elixir by Thaxll on Wednesday February 06, 2019 @08:17AM (#19094825)
FastHTTP is the fastest server for Go, it's going to crush Elixir by something like 10x, it's really fast like the fastest c++ / rust libraries.
Re:Benchmarking Go vs. Node vs. Elixir by deepsun on Wednesday February 06, 2019 @12:12AM (#19092879)
Re:Benchmarking Go vs. Node vs. Elixir by trp1 on Tuesday February 05, 2019 @11:01PM (#19092598)
Well 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.

Re:Benchmarking Go vs. Node vs. Elixir by fileeditview on Wednesday February 06, 2019 @06:00AM (#19094199)
There are so many options to choose from. But don't use Iris.

See https://www.reddit.com/r/golang/comments/57w79c/why_you_real...

Re:Benchmarking Go vs. Node vs. Elixir by schrodinger on Tuesday February 05, 2019 @11:03PM (#19092605)
Why would you not use the standard library’s http package. I would!
Re:Benchmarking Go vs. Node vs. Elixir by schrodinger on Tuesday February 05, 2019 @11:04PM (#19092612)
That’s the idiomatic way to handle requests in Go. What’s the problem?
Re:Benchmarking Go vs. Node vs. Elixir by wiennat on Wednesday February 06, 2019 @12:45AM (#19093008)
I don't have any problem with their Go implementation. Instead, it is very impressive to me who has little knowledge in Go.

I just want to point out that Node runs with a single thread so it does not max out CPU utilization. It would be nice if the author does the benchmark again with multiple processes of node js.

Re:Benchmarking Go vs. Node vs. Elixir by theamk on Wednesday February 06, 2019 @01:47AM (#19093222)
Maybe they were simulating some sort of messaging server, or a shared cache, or something else which does not translate well to multiple process model?
Re:Benchmarking Go vs. Node vs. Elixir by supermatt on Wednesday February 06, 2019 @06:06AM (#19094233)
Id like to see metrics on memory consumption - is this something you could add?
Re:Benchmarking Go vs. Node vs. Elixir by kt315_ on Wednesday February 06, 2019 @05:46PM (#19100917)
Good point, will add.
Re:Benchmarking Go vs. Node vs. Elixir by supermatt on Thursday February 07, 2019 @04:41AM (#19104115)
many thanks!
Re:Benchmarking Go vs. Node vs. Elixir by therockhead on Wednesday February 06, 2019 @12:32AM (#19092955)
Would be interesting to compare with Java.
Re:Benchmarking Go vs. Node vs. Elixir by pjmlp on Wednesday February 06, 2019 @02:56AM (#19093477)
Re:Benchmarking Go vs. Node vs. Elixir by kt315_ on Wednesday February 06, 2019 @05:47PM (#19100927)
What would be the good Java web server to test?
Re:Benchmarking Go vs. Node vs. Elixir by johnisgood on Wednesday February 06, 2019 @03:24AM (#19093588)
Slightly off-topic, but: I love those graphs. Any ideas how they created them, or what they are using?
Re:Benchmarking Go vs. Node vs. Elixir by crave_ on Wednesday February 06, 2019 @04:41AM (#19093877)
Re:Benchmarking Go vs. Node vs. Elixir by gyrgtyn on Tuesday February 05, 2019 @06:43PM (#19091271)
Wonder 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.

Re:Benchmarking Go vs. Node vs. Elixir by rekoros on Tuesday February 05, 2019 @03:41PM (#19089589)
Surprising that BEAM is such a CPU hog!
Re:Benchmarking Go vs. Node vs. Elixir by toast0 on Tuesday February 05, 2019 @10:48PM (#19092549)
BEAM 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.
Re:Benchmarking Go vs. Node vs. Elixir by brightball on Friday February 08, 2019 @10:59AM (#19115405)
It 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?

Re:Benchmarking Go vs. Node vs. Elixir by someguy101010 on Tuesday February 05, 2019 @06:44PM (#19091273)
Tldr?
Re:Benchmarking Go vs. Node vs. Elixir by hactually on Tuesday February 05, 2019 @07:48PM (#19091646)
Node bad, Elixir good but spikey on the CPU, Go best.
Re:Benchmarking Go vs. Node vs. Elixir by Juliennng on Monday February 11, 2019 @07:31PM (#19139920)
It 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
Re:Benchmarking Go vs. Node vs. Elixir by turbo_fart_box on Wednesday February 06, 2019 @07:19AM (#19094526)
I would love some sort of bot that I could point at blog posts that could summarize articles with the exact language you used.
Re:Benchmarking Go vs. Node vs. Elixir by Madeindjs on Thursday February 07, 2019 @04:46PM (#19108895)
I read article and I saw that Node is not so bad at all..
Re:Benchmarking Go vs. Node vs. Elixir by turbo_fart_box on Wednesday February 06, 2019 @07:18AM (#19094521)
God's work. Thanks