Re:Phoenix 1.7 for Elixir: Edit a Form in a Modal
by parthdesai on Tuesday September 12, 2023 @09:35AM
(#37480989)
A caveat with libcluster + k8s though - it doesn't play nicely with sudden burst of traffic.
Re:Phoenix 1.7 for Elixir: Edit a Form in a Modal
by weatherlight on Tuesday September 12, 2023 @10:24AM
(#37481805)
Can you talk about this more? :) Why is that the case?
Re:Phoenix 1.7 for Elixir: Edit a Form in a Modal
by parthdesai on Tuesday September 12, 2023 @05:24PM
(#37488627)
I'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
Re:Phoenix 1.7 for Elixir: Edit a Form in a Modal
by weatherlight on Wednesday September 13, 2023 @02:51PM
(#37500200)
thanks for such a concise answer!
Re:Phoenix 1.7 for Elixir: Edit a Form in a Modal
by RexM on Tuesday September 12, 2023 @10:31AM
(#37481910)
Could 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.
Re:Phoenix 1.7 for Elixir: Edit a Form in a Modal
by parthdesai on Tuesday September 12, 2023 @05:28PM
(#37488700)
Re:Phoenix 1.7 for Elixir: Edit a Form in a Modal
by abrookewood on Tuesday September 12, 2023 @09:33PM
(#37491092)
To 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.
Re:Phoenix 1.7 for Elixir: Edit a Form in a Modal
by waynesonfire on Tuesday September 12, 2023 @12:17PM
(#37483561)
how do you do deploy / bundle your configs?
Re:Phoenix 1.7 for Elixir: Edit a Form in a Modal
by melx on Wednesday September 13, 2023 @05:36AM
(#37494423)
I 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.
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/
[1] https://fly.io/docs/elixir/getting-started/
[2] https://elixir-lang.org/getting-started/mix-otp/config-and-r...
[3] https://github.com/bitwalker/libcluster