News for hackers. Stuff that matters.
Re:Elixir 1.12 by yannoninator on Wednesday May 19, 2021 @07:33AM (#27207159)
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?

Re:Elixir 1.12 by chrismccord on Wednesday May 19, 2021 @10:44AM (#27209340)
For 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 :)
Re:Elixir 1.12 by mrkurt on Wednesday May 19, 2021 @07:49AM (#27207291)
This runs on 256mb VMs and works well even when it gets busy: 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/

Re:Elixir 1.12 by josevalim on Wednesday May 19, 2021 @08:59AM (#27207942)
> 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 - 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.

Re:Elixir 1.12 by brightball on Wednesday May 19, 2021 @01:00PM (#27211364)
Because 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-...

Re:Elixir 1.12 by 1_player on Wednesday May 19, 2021 @10:39AM (#27209278)
My 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.
Re:Elixir 1.12 by acdibble on Wednesday May 19, 2021 @07:46AM (#27207259)
I 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.
Re:Elixir 1.12 by tommica on Wednesday May 19, 2021 @04:24PM (#27214025)
Is it just "mix build" that you run, or something more special?
Re:Elixir 1.12 by linkdd on Wednesday May 19, 2021 @08:35AM (#27207692)
For 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.

Re:Elixir 1.12 by thibaut_barrere on Wednesday May 19, 2021 @10:05AM (#27208793)
I'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.

Re:Elixir 1.12 by mrjoelkemp on Wednesday May 19, 2021 @08:00AM (#27207391)
I have 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).
Re:Elixir 1.12 by sbarre on Wednesday May 19, 2021 @08:02AM (#27207407)
Oops I think we broke your app.
Re:Elixir 1.12 by nwsm on Wednesday May 19, 2021 @08:52AM (#27207852)
Something something demo gods
Re:Elixir 1.12 by deallocator on Wednesday May 19, 2021 @09:22AM (#27208188)
HN hug of death strikes again
Re:Elixir 1.12 by shakow on Wednesday May 19, 2021 @01:12PM (#27211507)
> Elixir isn't very memory efficient when it comes to web servers.

I'm serving (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.

Re:Elixir 1.12 by dudul on Wednesday May 19, 2021 @10:05AM (#27208801)
Just to get a frame of reference, what is memory efficient for web servers?
Re:Elixir 1.12 by conradfr on Wednesday May 19, 2021 @08:55AM (#27207888)
You 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.
Re:Elixir 1.12 by thejosh on Wednesday May 19, 2021 @08:10AM (#27207468)
Huh? Elixir isn't memory effecient, compared to what exactly :)?
Re:Elixir 1.12 by andy_ppp on Wednesday May 19, 2021 @11:20AM (#27209929)
It also really depends what you're doing - if you need millions of processes almost nothing is more memory efficient.
Re:Elixir 1.12 by deallocator on Wednesday May 19, 2021 @09:23AM (#27208200)
assembly probably /s
Re:Elixir 1.12 by cpursley on Wednesday May 19, 2021 @10:01AM (#27208747)
Render.com does a great job at running distributed Elixir.