4 ms·
You can host Elixir apps on PaaS like Gigalixir[0] or Fly.io[1] (no associated with these). I personally use mix release[2] that assembles a tarball of itself
by melx 3y ago
You can host Elixir apps on PaaS like Gigalixir[0] or Fly.io[1] (no associated with these).
I personally use mix release[2] that assembles a tarball of itself (together with BEAM), then rsync that to Hetzner, restart the remote process and viola. I like simplicity.
Re cluster of nodes, the easiest would be to use a library[3] to automate the formation of said cluster.
[0] https://www.gigalixir.com/ https://www.gigalixir.com/
[1] https://fly.io/docs/elixir/getting-started/ https://fly.io/docs/elixir/getting-started/
[2] https://elixir-lang.org/getting-started/mix-otp/config-and-releases.html#releases https://elixir-lang.org/getting-started/mix-otp/config-and-r...
[3] https://github.com/bitwalker/libcluster https://github.com/bitwalker/libcluster
- parthdesai 3y agoA caveat with libcluster + k8s though - it doesn't play nicely with sudden burst of traffic.
- weatherlight 3y agoCan you talk about this more? :) Why is that the case?
- parthdesai 3y agoI'll give you a bit of background to explain it better. Our service is primarily a graphql API. The mobile apps talk to our service, and then it internally talks to other services. We use Absinthe for graphql, and a lot of it is subscription based. Since these nodes (pods in k8s terms) are clustered, each pod is aware of the other pod. Sometimes we get a huge spike in traffic and the clusters can't start fast enough (we're increasing the scale up time in k8s) and a pod can get OOM killed due to number of graphql subscription and then just go in crashloop. This leads to libcluster thinking the node is still good but when infact it's in crashloop, and thus not allowing any new pods coming up to start up. We're experimenting with few things, but yeah clustering is not without it's pain
- weatherlight 3y agothanks for such a concise answer!
- RexM 3y agoCould you expand on that or link to something that does? I was considering using libcluster on k8s, so curious about the limitations you're referring to.
- parthdesai 3y agohttps://news.ycombinator.com/item?id=37488627 https://news.ycombinator.com/item?id=37488627 :)
- abrookewood 3y agoTo be fair, there are problems with other languages/runtimes and bursty traffic as well - autoscaling isn't great when it takes 20 minutes to provision a new server to run your .Net app.
- waynesonfire 3y agohow do you do deploy / bundle your configs?
- melx 3y agoI compile the tarball using Dockerfile, as the target OS must be the same as source OS to compile it (I deploy Debians on remote, and use Fedora locally). Then there's bunch of mix tasks to bundle the js/css assets - it's all really there ready to be used. The other day I spent half a day implementing same behaviour for Django app.