How Discord Scaled Elixir to 5,000,000 Concurrent Users
And some discussion on Hacker News about it (including some OTP 20.0 optimizations).
Their published libraries described in the blog post:
manifold : Fast batch message passing between nodes for Erlang/Elixir
ex_hash_ring : A fast consistent hash ring implementation in Elixir
fastglobal : Fast no copy globals for Elixir & Erlang
semaphore : Fast semaphore using ETS
At last the praised free book from Fred Hebert: Stuff Goes Bad: Erlang in Anger
27 Likes
AstonJ
July 11, 2017, 9:58pm
2
Nice
I’ve made some changes to our Showcase section and moved this there
Another blog post from Discord:
Oh now that is very cool, they made a lot of little micro-libraries (micro as in one-file) that are very useful and simple.
3 Likes
tmbb
July 11, 2017, 11:56pm
4
Recompiling code on the fly so that the datastructure is “constant” is impossibly cool xD best cache ever
4 Likes
Using Rust to Scale Elixir for 11 Million Concurrent Users
Nowadays it seems like they use a faster implementation with NIFs, here’s the library: SortedSet
9 Likes
Thanks for the link, that is really handy. I implemented a custom MapSet with Erlang 21+ features which is 25% faster than the native MapSet, I expect this can be an even bigger improvement.
6 Likes
tmbb
May 18, 2019, 1:46pm
7
You should submit a PR to Elixir then!
3 Likes
Absolutely, I planned on submitting a PR after support for Erlang 20 was dropped. That will probably be quite a while though, so I’ll probably investigate conditional compilation instead.
3 Likes