Live data from Hacker News

Achieving 100k connections per second with Elixir

stressgrid.com

81–90 of 117 posts

Re: Achieving 100k connections per second with Elixir

#81

Earlier quoted context omitted.

Instead of downvoting this comment, can someone write why this is incorrect? I realize it might not be a popular writing style, but references were provided.

Because it's not hugely relevant. Yes, Erlang is not a "fast" language by many metrics, but that [very often] is not the reason a team would choose to use it. The sibling and parent comments make up a fairly considered discussion regarding this. A comment in the middle of this conversation saying Go etc win in some benchmark game is a non sequitur

I was replying to someone saying that it depends of the library, the answer is no it doesn't depends of the library, Erlang is not a fast language and it's ok.

Re: Achieving 100k connections per second with Elixir

#82
post #71

Earlier quoted context omitted.

Go is faster than Erlang and not by a small margin, Erlang is a dynamic and immutable language, it hurts performance compare to languages like Go. Some benchmark about pure CPU computation: https://benchmarksgame-team.pages.debian.net/benchmarksgame/... Erlang is really slower than Java Go and Java now: https://benchmarksgame-team.pages.debian.net/benchmarksgame/... You see the big difference, Go and Java are on part…

Instead of downvoting this comment, can someone write why this is incorrect? I realize it might not be a popular writing style, but references were provided.

There's different kinds of "fast" is the problem.

Are you juggling lots of messages concurrently and orchestrating across complex topologies of nodes? A BEAM language is going to excel. That's why Whatsapp, Discord, and RabbitMQ use Erlang/Elixir.

Are you trying to go really fast in a straight and simple concurrency scenario? Go/Java/C++/Rust is going to be faster than a BEAM language in those scenarios.

You won't want to implement a complex concurrency run-time in Java whereas Elixir is not a good choice for a 3D game engine.

Still, there's nothing wrong with using both.

Re: Achieving 100k connections per second with Elixir

#83
post #57

Is Elixir/Erlang considered superior to Go for writing high concurrency web servers?

Not na expert in any of the languages by any means, but Go and Erlanger/Elixir focus on different things: - Go wants to be performant at high concurrency scale - Erlang/Elixir wants to keep running at high concurrency scales, whatever the issues are in your application code. Performance comes second. There's no clear cut answer to your question; I guess if you trust yourself to write servers that will hold a large nu…

I suspect it's probably much more straight forward to horizontally scale across nodes with Erlang/Elixir and OTP than with Go.

Re: Achieving 100k connections per second with Elixir

#84
post #66

ejabberd [0], XMPP server is written in erlang and powers chat in some of the biggest MMORPGs [1]. [0]: https://github.com/processone/ejabberd [1]: https://xmpp.org/uses/gaming.html

By used in MMORPGs you mean the chatting component, not the actual game-play network protocol.

Re: Achieving 100k connections per second with Elixir

#85

I'd love to see data on the average on-call incidents for an application written in language X (say Go) vs those written in Elixir. Concretely, its it the case, for an application where Elixir/Erlang/Beam are a great choice, but also, another language would be fine, that the equivalent Elixir application results in less downtime/pages than the alternative. Anything from the perfect app to something with a ton of race…

I don't have but I can tell you from my experience with Ruby, Go, Node and Elixir.

I have zero on-call for Go. I had very few for Elixir. But the bug were in logic code. Same with Ruby.

But it's a disaster with Node. We used TypeScript so it catch lot of type issue. However, the Node runtime is weird. We run into DNS issue(like yo have to bump the libuv thread pool, cache DNS). JSON parsing issue and block the event loop etc...max memory...

Re: Achieving 100k connections per second with Elixir

#86
post #70

Earlier quoted context omitted.

Presumably they were using cowboy through Elixir. It's not hard, the module is just called :cowboy instead of cowboy.

Or `Cowboy` with `alias :cowboy, as: Cowboy` ;)

Stick with the :module notation. This makes it clear that you need to be in "erlang mode"...indexes starting at 1, [probably] charlists instead of binaries, and possibly weird (from an elixir programmer's point of view) argument order.

Re: Achieving 100k connections per second with Elixir

#87

I'd love to see data on the average on-call incidents for an application written in language X (say Go) vs those written in Elixir. Concretely, its it the case, for an application where Elixir/Erlang/Beam are a great choice, but also, another language would be fine, that the equivalent Elixir application results in less downtime/pages than the alternative. Anything from the perfect app to something with a ton of race…

This would be too heavily influenced by confounding factors.

For instance:

* Are the teams that use certain languages comprised of more experienced people?

* How mature is the company and project? I.e., a faster moving startup cutting more corners, where time was decided to be of the essence (rightly or wrongly) will likely produce more on call incidents than a slower, more established company that can takes its time

Re: Achieving 100k connections per second with Elixir

#88
post #52

> What this means, performance-wise, is that measuring requests per second gets a lot more attention than connections per second. Usually, the latter can be one or two orders of magnitude lower than the former. does anyone know how does 100k connections compare with other servers?

Java was able to that for the longest time. I remember seeing async io based servers doing 500K or 1M connections per machine in the last ten years. In all cases they needed to reconfigure the OS kernel since that's where the bottleneck was.

A quick search shows that the problem has been shifted to tackle the so called C10M problem, with C1M/second. That was couple years ago. Not sure what the current state is.

http://highscalability.com/blog/2013/5/13/the-secret-to-10-m...

https://mrotaru.wordpress.com/2015/05/20/how-migratorydata-s...

Re: Achieving 100k connections per second with Elixir

#89
post #42
post #38

Earlier quoted context omitted.

It's probably easy to do with Java / C# and Go, they're using a 36 cores machine to achieve that with fast CPU, meaning that you need 3000conn/sec per core, very doable with recent frameworks.

Should be possible just fine with NodeJS, so long as it's clustered to run an instance per core. The order of magnitude(s) differentiator for server performance really comes down to whether or not the architecture is blocking or non-blocking.

We run about 20k connections per second with nodejs on a 12 core machine. All node is doing is parsing cached JSON, modifies it and serve it back to the client. One server has an uptime of 560days without any memory/performance issues.

Re: Achieving 100k connections per second with Elixir

#90
post #84
post #66

ejabberd [0], XMPP server is written in erlang and powers chat in some of the biggest MMORPGs [1]. [0]: https://github.com/processone/ejabberd [1]: https://xmpp.org/uses/gaming.html

By used in MMORPGs you mean the chatting component, not the actual game-play network protocol.

That's exactly what they said.
Post reply on HN