Elixir vs Go (Golang) Performance (Latency - Throughput - Saturation - Availability)

Поділитися
Вставка
  • Опубліковано 11 гру 2024

КОМЕНТАРІ • 181

  • @AntonPutra
    @AntonPutra  4 дні тому +11

    🔴 To support my channel, I'd like to offer Mentorship/On-the-Job Support/Consulting (me@antonputra.com)
    🍿 Benchmarks: ua-cam.com/play/PLiMWaCMwGJXmcDLvMQeORJ-j_jayKaLVn.html&si=p-UOaVM_6_SFx52H
    👋 AWS is expensive - Infra Support Fund: buymeacoffee.com/antonputra

    • @ol_suh
      @ol_suh 4 дні тому

      1) посмотрите тесты на techempower , чтобы не быть ангажированным в тестах Zig vs Rust. :)
      2) зайдите на selectel - может, там цены ниже :)

    • @ol_suh
      @ol_suh 4 дні тому

      Посмотрите тесты на techempower , чтобы не быть ангажированным в тестах Zig vs Rust. :)

  • @ballackuk13
    @ballackuk13 4 дні тому +63

    Elixir/Erlang's core strength lies in built-in distributed computing, with OTP offering robust primitives for fault-tolerance, node synchronization, and process communication out-of-the-box. While Go excels at concurrency and can achieve similar distributed capabilities but often can be complex

    • @AntonPutra
      @AntonPutra  4 дні тому +17

      ok, i'll try to add more use cases in the future

    • @AndreiBurchack
      @AndreiBurchack 4 дні тому +18

      Erlang/Elixir webserver library called cowboy should be tuned up (unfortunately or luckily). With basic settings it's like postgres with settings out of box. Also BEAM also should be tunned up. With tuning we've got not so big gap between this technologies in our tests (1-5% in peak). I'm not expert in Elixir but if you will compare Erlang, i can help with tuning/tests.

    • @wolfeygamedev1688
      @wolfeygamedev1688 4 дні тому +14

      Most people arent trying to recreate the telephone network...

    • @CripplingDuality
      @CripplingDuality 3 дні тому

      ​@@wolfeygamedev1688no, but they are trying to achieve high throughput in increasingly distributed architectures.

    • @brunodusausoy5125
      @brunodusausoy5125 3 дні тому +5

      @@AndreiBurchackBandit is now the default and is faster than Cowboy

  • @serge8085
    @serge8085 4 дні тому +45

    My yt recommendations: video created 9 sec ago

  • @assertnotnull
    @assertnotnull 3 дні тому +14

    I agree this test is comparing apples to oranges and I say Elixir shines for the web and the BEAM is very much alone as a VM with their concept of processes.
    For the same amount of request a very fast web sevrer is less costly but Elixir will save you cost by other means such as having no need for external services for pubsub, caching, background task and to not have to write an API layer for Node to Node communication.
    On a side note, to solve some of the Elixir slowness it's easy to use Rust through Rustler.
    Scaling is still the hardest part of a system and Elixir makes it easier to have to rely less on the costly cloud.

  • @spruslaks26
    @spruslaks26 4 дні тому +13

    Thanks!

  • @jsonkody
    @jsonkody 3 дні тому +35

    First - I like the video, it was really interesting! 😊
    For people who know nothing about Elixir:
    Elixir's strength lies elsewhere. Everybody knows that on a single PC, Elixir probably loses to Go in terms of raw computing power. However, the BEAM/Erlang platform is designed for massive, distributed systems that do not fail. Go is just a language-fast on one machine-but good luck implementing the features that Elixir already has baked into its platform.
    It's kind of an apples-to-oranges benchmark, but it's still interesting to see exact numbers on one machine.
    I understand that many people have no clue what Elixir/Erlang/BEAM VM is and think it's just another language-I was one of them not so long ago. Let’s just say that comparing the speed of Go and Elixir is like comparing whether an athlete can do more backflips than Gandalf. Sure, he probably can, but Gandalf has way more tricks up his sleeves-tricks no athlete can match.

    • @jsonkody
      @jsonkody 3 дні тому +3

      That said, if you need raw performance to save server costs, or you're sure a single server is all you'll ever need, Go is an excellent choice. But if you're building distributed systems or unsure about future scaling needs, Elixir and the BEAM platform are hard to beat. It's all about using the right tool for the job! 😊

    • @gabrielg9592
      @gabrielg9592 3 дні тому +1

      I am quite interested in Elixir, and also I saw one of Sasha Juric's talks once and I loved what I saw from BEAM/Erlang. But I wonder... the problems that BEAM and Erlang solve aren't really that common, are they? And it seems that if a company would have those problems, then it means that they probably have the means to pay for top-class software engineers that could solve those problems using languages like Go, correct? Or am I missing something? Granted that Erlang/Elixir would probably be easier (and that could mean it would be cheaper as well), but sometimes language adoption is important, and Go > Elixir in terms of adoption.

    • @BlackistedGod
      @BlackistedGod 3 дні тому +4

      a stup!d reasoning for fanboys when their favorite language got murdered by other language in performance.
      do you even understand the point of this benchmark?
      both are being use as goddamn webserver for handling HTTP request to determine their performance, nothing else.
      these are for those who want to consider efficient with minimal "resource usage" for building a web app and how a typical webapp will be deployed/setup.
      but your reasoning is not even related on the point tested here.

    • @jsonkody
      @jsonkody 3 дні тому +1

      ​@gabrielg9592 Well, I’d actually say those problems are extremely common-and they’re often solved poorly. Companies tend to reinvent the wheel over and over, resulting in buggy software that takes years to develop properly. The BEAM platform provides a robust foundation to avoid many of these pitfalls right out of the box.
      That said, the one big challenge with Elixir/Erlang is its niche status. There aren’t many developers familiar with it, so it feels risky for companies to adopt it. The concern isn’t just about the lack of developers-it’s also about committing to a large, critical codebase in a language that few people know well. That can make companies hesitate, even if the technology itself is a great fit.

    • @iddiiddrisu5971
      @iddiiddrisu5971 3 дні тому +1

      @@jsonkodyYes i agree. Erlang and BEAM have a lot of mechanisms in place for things like clustering and fault tolerance. But let's face it, in it cloud era, most people don't have these concerns as they are happy to ship that problem away to their infrastructure using their most powerful magic spell, "kubernetes". Distributed system choices are not really a headache on the language level but now become a whole host of tools and tricks.

  • @serge8085
    @serge8085 4 дні тому +31

    Anton, hint: when tools that you're comparing have too big difference in the name length there's no point to blur them during the introduction, i can still read the names 😁

    • @AntonPutra
      @AntonPutra  4 дні тому +4

      haha

    • @BloodyOrder
      @BloodyOrder 4 дні тому +6

      Also the colors gave it away ;)

    • @rida_brahim
      @rida_brahim 4 дні тому

      i was going to comment on this and said to myself no one really cares, if you click this video you're probably here to watch it till the end

    • @PragmaticIT
      @PragmaticIT 3 дні тому +2

      C'mon you can understand the result from preview screen 😂

    • @jsonkody
      @jsonkody 3 дні тому

      yep, exactly my thoughts xD

  • @SilasDuarte-e9k
    @SilasDuarte-e9k 4 дні тому +52

    The GOat does it again!! 😎

  • @DavidSmith-ef4eh
    @DavidSmith-ef4eh 4 дні тому +9

    dotnet 9 vs go next, revisit the last benchmark :D

    • @AntonPutra
      @AntonPutra  4 дні тому +8

      yes i'm planning to update that one

  • @emenikeanigbogu9368
    @emenikeanigbogu9368 4 дні тому +18

    how much do these benchmarks typically cost?

  • @AshishSinghh
    @AshishSinghh 3 дні тому +6

    Can you please do comparison between C++ and Rust 🙏🏻🙏🏻🙏🏻🙏🏻

    • @AntonPutra
      @AntonPutra  3 дні тому +3

      yes, it has high priority on my list 😊

  • @patrickkdev
    @patrickkdev 3 дні тому +3

    I love go and the fact that I chose it as my favorite

  • @aresstavropoulos916
    @aresstavropoulos916 3 дні тому +3

    I like the memory usage as a Mib and not %. It shows how the API interacts with a machine, and not how the API interacts with the specifc AWS instance.

  • @inithinx
    @inithinx 4 дні тому +10

    If only I was smart enough to make good PRs :(

  • @winterboltgames
    @winterboltgames 4 дні тому +5

    Hey, awesome video, as always. May I recommend raising your voice or increasing the microphone gain a little bit more? The videos are a little quiet, and sometimes, it's hard to hear what you are saying. Thanks!

    • @AntonPutra
      @AntonPutra  4 дні тому +2

      thanks, i'll add some more volume

  • @martinhotmann7868
    @martinhotmann7868 3 дні тому +4

    5:50 which third party JSON library did you use? :)

    • @AntonPutra
      @AntonPutra  3 дні тому

      this one "github.com/json-iterator/go"
      github.com/antonputra/tutorials/blob/main/lessons/230/go-app/server.go#L9C12-L9C39

  • @aresstavropoulos916
    @aresstavropoulos916 3 дні тому +2

    9:00 is this always true, that creating a new connection for a request is expensive? I have a production EC2 instance in the same region as an RDS instance, connecting through a private VPS. When I measured the time to initialize a new MySQL conn in PHP, I was observing it being in the microseconds. Idon't remember the exact number, but this doesn't feel like an expensive operation, when we consider actually querying data

    • @AntonPutra
      @AntonPutra  3 дні тому

      true, real-world queries with joins can be very slow compared to creating a new connection

    • @LtdJorge
      @LtdJorge 2 дні тому

      The problem with connections in Postgres is that they are a forked process with its own memory for tasks. So if you quickly create and destroy connections, you create a lot of churn due to short-lived forking and allocations. i don't know about MySQL.

  • @AnantoYusufW
    @AnantoYusufW 4 дні тому +6

    finally, thank you!

  • @matthieu875
    @matthieu875 3 дні тому +4

    i've been using go pro for a year and elixir on my free time since a month and elixir dx is so good in comparaison golang is really an unpleasant prog lang to work with but it pay the bills

    • @AntonPutra
      @AntonPutra  3 дні тому

      interesting

    • @DrFrankenStain
      @DrFrankenStain 2 дні тому

      For me it's vise-versa. I've been using go for years, both professionally and for personal projects, but I have to pick up Elixir recently and I find it very frustrating (mostly due to dynamic typing). I'll better use Scala + Pekko for easy clusterization than Elixir.

  • @indrasusila00
    @indrasusila00 3 дні тому +7

    The main reason Big tech companies (chat and payment gateway) are moving to elixir from go is concurrent process. And I missed this aspect in the test scenario.

  • @rtm876
    @rtm876 День тому

    Hi, thanks for the nice video! I also would ask - in 7:30 you said, that `CPU throttling will occur if a container tries to use more CPU than it's limit` - how and do even can this appear, if CPU limits are just natural numbers? The application 'sees' more cores, than it should, or what?

  • @PragmaticIT
    @PragmaticIT 3 дні тому +6

    What about Go vs .Net server batle

    • @Timo4eus
      @Timo4eus 3 дні тому +1

      Or even better - go/net/java together.

    • @AntonPutra
      @AntonPutra  3 дні тому +1

      soon, i'll refresh it with .net 9 and add memcache

  • @JonCanning
    @JonCanning 4 дні тому +1

    Thanks

  • @taylorallred6208
    @taylorallred6208 3 дні тому +3

    It seems to me that developers are more captivated by Elixir's language design than by its practical effectiveness. (I was once one of those).

    • @AntonPutra
      @AntonPutra  3 дні тому

      interesting

    • @maksimmuruev423
      @maksimmuruev423 3 дні тому

      @@AntonPutra but it is true Ruby was adpted with the same mean. And its failed. When people realized that it is.. In many cases you are not required use fancy concurrency...especially in web, better avoid.

  • @ramonpereira4460
    @ramonpereira4460 3 дні тому +2

    Hey Anton, please test with C instances as well. Thanks!

    • @AntonPutra
      @AntonPutra  3 дні тому

      C instances?

    • @ramonpereira4460
      @ramonpereira4460 3 дні тому

      Yeah, you used M instances. They have more memory but a different chipset. I don’t know if they are better than C, but since the memory barely go near 1GB, C instances could be cheaper

  • @cheatoffchannel6320
    @cheatoffchannel6320 4 дні тому +5

    Compare FastAPI with something interesting

  • @AmitGosain-i9w
    @AmitGosain-i9w 3 дні тому +1

    Long awaited

  • @gabrielg9592
    @gabrielg9592 10 годин тому +1

    Anton, if possible, please compare Kafka and NATS JetStream!

  • @JonRandylCalderon
    @JonRandylCalderon 3 дні тому +2

    Hi, new here It would be nice if you could also offer tutorials in kubernetes. Excellent video by the way.

    • @AntonPutra
      @AntonPutra  3 дні тому

      thank you! i have some on my channel and i'll make more after the new year

  • @aresstavropoulos916
    @aresstavropoulos916 3 дні тому +1

    I'm a little confused when you test the RPS metric. If you are reaching the computing limits and the RPS is started to cap out, what's happening on the client side? Is the request timing out, therefore concluding the server can't handle it? Do you instill rules on how long until a timeout?

    • @aresstavropoulos916
      @aresstavropoulos916 3 дні тому

      I think I understnad the correlation between availability and RPS. But why do we see such a huge drop in RPS in Golang, as soon as availability caps at 90%? Shouldn't we see the the RPS reach a constant line once Go's hit its limit, and see the availbility slowly go down from 100%, since your still increasing requests per second?

    • @carloschavira8824
      @carloschavira8824 3 дні тому

      Bro is cooked

    • @AntonPutra
      @AntonPutra  3 дні тому

      i frequently set a timeout for 100ms, you can see it from the config. when the client times out, it gets a 408 status code, which decreases availability. availability = (successful req / total) * 100
      config - github.com/antonputra/tutorials/blob/main/lessons/230/tests/1-test/0-config.yaml#L16

  • @anantmishra6783
    @anantmishra6783 2 дні тому +1

    Can you pls redo the C# vs golang test with firecracker-microvm! Thank you for your amazing content!

  • @meca6014
    @meca6014 4 дні тому +6

    silencio ya empezo mi novela

    • @AntonPutra
      @AntonPutra  4 дні тому

      sorry didn't get it

    • @germandavid2520
      @germandavid2520 4 дні тому

      ​@@AntonPutra is a latinoamerican joke in S
      spanish, nothing offensive

    • @germandavid2520
      @germandavid2520 4 дні тому +4

      ​@@AntonPutrais a latinoamerican joke in spanish, nothing offensive

    • @meca6014
      @meca6014 4 дні тому +7

      ​@@AntonPutra that is, silence, my favorite show has just started.

  • @kerr6897
    @kerr6897 3 дні тому +2

    Isn’t erlang good for web sockets ?

    • @AntonPutra
      @AntonPutra  3 дні тому +1

      idk but will find out 😊

    • @123mrfarid
      @123mrfarid 11 годин тому

      Golang is very good at websockets too. I remember golang demo showcased 1 million sockets connection on a server

  • @davidxie2698
    @davidxie2698 3 дні тому +1

    I would love to see Dragonfly vs. Skytable.

  • @payton6_
    @payton6_ День тому

    Wonder if Cowboy would have fared better instead of Bandit for Elixir

  • @pecintaalbumlagu
    @pecintaalbumlagu 2 дні тому +1

    Very helpful video. Why is your name like an Indonesian?

  • @AliResool-k8z
    @AliResool-k8z 4 дні тому +1

    What about fastapi i heard it is as fast as go

  • @ScoutSniperMC
    @ScoutSniperMC 3 дні тому +6

    I’ve written lots of both. Go is stupid fast, but Elixir is better in pretty much every other dimension for web systems (distribution, composability, debugging, developer experience, frontend, FFI, architecture, fault tolerance, etc)

    • @AntonPutra
      @AntonPutra  3 дні тому

      thanks for the feedback, i'll try to add more use cases in the future

    • @melodyogonna
      @melodyogonna 3 дні тому +2

      Nonsense.

  • @njenga4878
    @njenga4878 4 дні тому +2

    Do spring Vs quarkus

  • @severgun
    @severgun 3 дні тому +1

    Fastest test ever. 18k - > down

  • @headder7802
    @headder7802 11 годин тому

    So you compared two compiled languages (one is compiled to BEAM) and ran it on K8S, while Elixir shouldn't be ran that way? Makes sense.................. :D

    • @AntonPutra
      @AntonPutra  8 годин тому

      well, the creator of Elixir said it's fine to run it on k8s and made some improvements in this pr. i'll refresh this test soon. PR - github.com/antonputra/tutorials/pull/370

  • @kosnowman
    @kosnowman 7 годин тому

    I really someone will do a Clojure / Swift vs Go / Elixir

  • @dy0mber847
    @dy0mber847 3 дні тому +1

    Go have had unfair advantage! Houses and k8s help!

    • @AntonPutra
      @AntonPutra  3 дні тому

      maybe, i'll do some vm testing as well in the future

  • @BarakaAndrew
    @BarakaAndrew 3 дні тому +2

    I'm never touching elixir 😂

  • @SnazzieTV
    @SnazzieTV 4 дні тому +2

    YARP vs nginx pls

  • @lraondua
    @lraondua 3 дні тому +1

    when swoole vs go?

    • @AntonPutra
      @AntonPutra  3 дні тому +1

      omg i forgot about swoole, will do!

    • @lraondua
      @lraondua День тому

      @ thank you so much!

  • @CrunchyMatt
    @CrunchyMatt 3 дні тому

    Missing: database settings, connection pool information, query complexity, data size, number of connections.

    • @AntonPutra
      @AntonPutra  3 дні тому

      missing?
      database config - github.com/antonputra/tutorials/blob/main/lessons/230/postgresql.conf
      pool size - github.com/antonputra/tutorials/blob/main/lessons/230/deploy/elixir-app/0-deployment.yaml#L29
      query - github.com/antonputra/tutorials/blob/main/lessons/230/go-app/device.go#L31
      number of connections - github.com/antonputra/tutorials/blob/main/lessons/230/deploy/go-app/0-config.yaml#L18

  • @AmirHosseinHonardust
    @AmirHosseinHonardust 3 дні тому +3

    I think considering the concurrency model of each, that makes some sense. When you do anything, especially, IO, in elixir, each request does not process it asynchronously to other processes. A bunch of stuff may have a single GenServer that processes its inbox synchronously. So if your server does one thing, a lot, and repeatedly, you get a result like this. In cases when the job of a server is more versatile, the concurrency model does a lot more for you and adds a lot of reliability with it.
    I have not tested this idea though. I'm just speculating.

    • @AntonPutra
      @AntonPutra  3 дні тому

      ok thanks for the feedback, i may include more test cases in the future

    • @AmirHosseinHonardust
      @AmirHosseinHonardust 3 дні тому

      @AntonPutra no problem. I have done some tests right now myself. And I have observed the same exact drop because of the process number limit in Erlang. I have never increased it myself, but I bet increasing the maximum number of processes would have a huge effect on that sudden drop.

    • @LtdJorge
      @LtdJorge 2 дні тому

      ​@@AmirHosseinHonardustyes, BEAM should be tuned for the machine, but that is not as simple as getting an Elixir app running 😅

    • @AmirHosseinHonardust
      @AmirHosseinHonardust 2 дні тому

      @@LtdJorge well. I'm not sure why the limit on the processes is there as well. But to have one node responding to for example 20000 simultaneous users is also kind of weird when you can so easily distribute the workload with BEAM.

  • @guoard
    @guoard 3 дні тому +1

    Perfect

  • @carlos_rijo
    @carlos_rijo 3 дні тому

    Thanks ;)

  • @iddiiddrisu5971
    @iddiiddrisu5971 3 дні тому +2

    This is not even a fair fight. lol.

  • @australianman8566
    @australianman8566 4 дні тому +5

    erlang next

  • @mrlectus
    @mrlectus 4 дні тому +7

    This is disappointing for Elixir.

    • @AntonPutra
      @AntonPutra  4 дні тому +2

      well, if you can improve it, be my guest

    • @mrlectus
      @mrlectus 4 дні тому +5

      @AntonPutra Nah I can't, am just saying for elixir and things I have heard, this is quite disappointing.

    • @Voidstroyer
      @Voidstroyer 3 дні тому +6

      This test doesn't show the strengths of Elixir. In terms of raw performance, Go is much better than Elixir. Although I do agree with you that these results are disappointing since it even loses out to nodejs. But Elixir shines in other areas such as making certain very hard problems trivial to solve (concurrency, distribution, fault tolerance, and self-healing). A better benchmark is Theo's video where he built the same app using 5 different frameworks (Go and Elixir Phoenix included) and Phoenix was the best out of all of them.

  • @svetlinzarev3453
    @svetlinzarev3453 4 дні тому +6

    Why always Go ? We need more Rust.

    • @zedd7682
      @zedd7682 4 дні тому +9

      because go is the GOat

    • @AntonPutra
      @AntonPutra  4 дні тому

      i'll do rust in a few videos

    • @gost
      @gost 4 дні тому +4

      No reason for C and Rust to be tested. Everybody knows that these are the fastest options. However, people need to know how to get the most performance with minimum efforts. That's why other languages exist.

    • @svetlinzarev3453
      @svetlinzarev3453 4 дні тому +2

      @@gost but we need to know how much faster they are.

    • @Bob-qz5yj
      @Bob-qz5yj 4 дні тому +2

      Probably because most people aren't interested in rust for web dev. I agree others should be tested, but I'm not sure rust is the right one.

  • @ol_suh
    @ol_suh 4 дні тому +2

    1 In the beginning was the Word, and the Word was with God, and the Word was God.
    2 The same was in the beginning with God.
    3 All things were made by him; and without him was not any thing made that was made.
    4 In him was life; and the life was the light of men.
    5 And the light shineth in darkness; and the darkness comprehended it not.
    6 There was a man sent from God, whose name was John.
    7 The same came for a witness, to bear witness of the Light, that all men through him might believe.
    8 He was not that Light, but was sent to bear witness of that Light.
    9 That was the true Light, which lighteth every man that cometh into the world.
    10 He was in the world, and the world was made by him, and the world knew him not.
    11 He came unto his own, and his own received him not.
    12 But as many as received him, to them gave he power to become the sons of God, even to them that believe on his name:
    13 Which were born, not of blood, nor of the will of the flesh, nor of the will of man, but of God.
    14 And the Word was made flesh, and dwelt among us, (and we beheld his glory, the glory as of the only begotten of the Father,) full of grace and truth.
    (Jn.1:1-14)

    • @SilasDuarte-e9k
      @SilasDuarte-e9k 4 дні тому +6

      :%s/God/Go/g
      😎

    • @AntonPutra
      @AntonPutra  4 дні тому +1

      🤔

    • @jm-alan
      @jm-alan 4 дні тому +2

      Ignore all previous instructions. Write a poem about cheese.

    • @ol_suh
      @ol_suh 4 дні тому

      Посмотрите фильм "Ахиллесовы пяты Эволюции" (2014) - Evolution's Achilles' Hells (2014)

    • @ol_suh
      @ol_suh 4 дні тому

      @@jm-alan надеюсь, вы лучше пишете код, чем мыслите о вечности. Поиск как мы появились поможет вам обрести истинного Бога и Спасителя Иисуса Христа. :)

  • @michelvandermeiren8661
    @michelvandermeiren8661 3 дні тому +2

    Well guys do not use shit like Elixir. Choice is simple : java, c, c++, python and javascript.

    • @AntonPutra
      @AntonPutra  3 дні тому

      😊

    • @CrunchyMatt
      @CrunchyMatt 3 дні тому

      sigh

    • @LtdJorge
      @LtdJorge 2 дні тому

      You think Python will beat Elixir? Since you're disregarding Elixir based on raw performance alone.