5 ms·
Looking into Elixir, but from what i've heard, Elixir isn't very memory efficient when it comes to web servers. Is that still the case? Also where does one ho
by yannoninator 5y ago
Looking into Elixir, but from what i've heard, Elixir isn't very memory efficient when it comes to web servers.
Is that still the case?
Also where does one host Elixir apps these days? Heroku, Vercel or Bare metal?
- acdibble 5y agoI host a pet project Slack bot on a Digital Ocean droplet. You can compile an Elixir app into an executable that treeshakes the BEAM. I can't speak to memory usage, but deployment for me is as easy as compiling an executable and putting it on the server.
- tommica 5y agoIs it just "mix build" that you run, or something more special?
- mrkurt 5y agoThis runs on 256mb VMs and works well even when it gets busy: https://liveview-counter.fly.dev https://liveview-counter.fly.dev And I'm biased, but we are a pretty good place to run an Elixir app: https://fly.io/docs/getting-started/elixir/ https://fly.io/docs/getting-started/elixir/
- mrjoelkemp 5y agoI have https://elixirdaily.link https://elixirdaily.link (an elixir/beam news aggregator running) on the smallest, free Gigalixir VM just fine. Does a ton of memory intensive work and doesn't go OOM (had to be careful with # outbound http connections).
- sbarre 5y agoOops I think we broke your app.
- nwsm 5y agoSomething something demo gods
- deallocator 5y agoHN hug of death strikes again
- thejosh 5y agoHuh? Elixir isn't memory effecient, compared to what exactly :)?
- deallocator 5y agoassembly probably /s
- andy_ppp 5y agoIt also really depends what you're doing - if you need millions of processes almost nothing is more memory efficient.
- linkdd 5y agoFor me, it's: libcluster (automatic clustering with Kubernetes Service) + horde (distribute workload across cluster) + Kubernetes Deployment Whenever I need to upgrade, I perform a rollout, new OTP application instances perform a takeover, once it's done previous pods are taken down.
- conradfr 5y agoYou could create a Phoenix project, launch it and use the erlang observer or the Phoenix LiveDashboard to monitor memory consumption and decide if that suits you.
- josevalim 5y ago> Looking into Elixir, but from what i've heard, Elixir isn't very memory efficient when it comes to web servers. It really depends on your reference point and what your web servers are doing. The Elixir website has a series of cases and perhaps you can find an example closer to what you are doing: https://elixir-lang.org/cases.html https://elixir-lang.org/cases.html - there are also cases where companies reduced the number of nodes in production once they migrated to Elixir. Regarding deployments, Heroku, Gigalixir, Fly.io, Droplets, K8s, etc are all viable options.
- cpursley 5y agoRender.com does a great job at running distributed Elixir.
- thibaut_barrere 5y agoI've heard some stories, mostly around XML handling if I recall well, and also due to people not using a form of streaming when it would have been necessary. I'm curious to know what you have heard with more precision, if possible.
- dudul 5y agoJust to get a frame of reference, what is memory efficient for web servers?
- 1_player 5y agoMy Elixir backend, doing background processing, admin interface, data ingestion and serving data via GraphQL consumes 300 MB RAM on average, which is 20% less memory than the Node/Next.JS React frontend. YMMV.
- chrismccord 5y agoFor a frame of reference, an Erlang VM running all of Phoenix will consume 16MB memory on startup, so we need more details on what exactly you've heard and for what usecases. For the Phoenix channels 2M connection benchmark, some folks claimed go uses less memory for websockets, but neglected to consider our realtime layer monitors connections for multiplexed messaging, handles distributed PubSub, etc, so it wasn't a proper comparison. There are certainly nuanced convos we could have about memory usage vs other platforms, but a blanket "non memory efficient for web" anecdote is inaccurate :)
- brightball 5y agoBecause of the way that Phoenix handles HTML templates it’s probably one of the most memory efficient. https://bignerdranch.com/blog/elixir-and-io-lists-part-2-io-lists-in-phoenix/ https://bignerdranch.com/blog/elixir-and-io-lists-part-2-io-...
- shakow 5y ago> Elixir isn't very memory efficient when it comes to web servers. I'm serving (https://domovik.app https://domovik.app) for a few dozen people on a few dozens MB of RAM. Sure, it's not Google scale, but I really can't complain about memory usage.