jukvalim

jukvalim

Serverless Elixir with Cloud Run min instances

Elixir is considered a bad match for serverless because BEAM is relatively slow to start up. I think this just became less relevant with Cloud Run min instances.

One of the great things about serverless is its pay-for-what-you-use operating model that lets you scale a service down to 0. But for a certain class of applications, the not-so-great thing about serverless is that it scales down to 0, resulting in latency to process the first request when your application wakes back up again. This so-called “startup tax” is novel to serverless, since, as the name implies, there are no servers running if an application isn’t receiving traffic.

Today, we’re excited to announce minimum (“min”) instances for Cloud Run, our managed serverless compute platform. This important new feature can dramatically improve performance for your applications. And as a result, it makes it possible to run latency-sensitive applications on Cloud Run, so they too can benefit from a serverless compute platform.
[…]
With this feature, you can configure a set of minimum number of Cloud Run instances that are on standby and ready to serve traffic, so your service can start serving requests with minimal cold starts.

The way I’m reading it, just put your Elixir/Phoenix app inside a container, deploy to Cloud Run, and there you have it, serverless Elixir at low fixed cost + usage. Thoughts?

Most Liked

hauleth

hauleth

Cowboy is enough “serverless” for me. I do not need additional CGI-like layer on top of that. And in most cases I would use Elixir it is cheaper to have just small VM running somewhere for $5-$10 instead of dealing with FaaS infrastructure and their costs.

tcoopman

tcoopman

The quote about 100x is not about the JIT but about something else José is working on.
The improvements of the JIT are much more modest, bit still impressive. Between 100-300% for some real world applications. I don’t think that will improve the start-up time though.

About cloud run. In the past that didn’t support websockets so it wasn’t an option for me. I haven’t kept up with it though, so if anyone knows if that’s solved I might take a look at it again.

dimitarvp

dimitarvp

I spoke misinformed. Apologies.

Last Post!

derek-zhou

derek-zhou

My understanding is that they will not break existing websocket connections and re-balance them, however, new connections will be balanced. So as long as all your containers belong to the same OTP cluster with auto-joining, it should be the same as a manually managed OPT cluster.

Where Next?

Popular in Discussions Top

gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 40165 209
New
tomekowal
Hey guys! I want to create a toy project that shows a chart of temperature over time and updates every 5 seconds. I feel LiveView is per...
New
thojanssens1
It would be nice to be able to define a redirect from one route to another from the router.ex file. E.g.: redirect "/", UserController, ...
New
Fl4m3Ph03n1x
Background This question comes mainly from my ignorance. Today is Black Friday, one of my favorite days of the year to buy books. One boo...
New
marciol
Please, let me know if this kind of discussion already took place in another topic . Hi all, how do you consider if is better to build ...
New
cvkmohan
The upcoming Phoenix 1.6 release looks very interesting. Became a habit to watch the commits - and - what they are bringing in. phx.gen...
New
shishini
I think this twitter post and youtube video didn’t get as much attention as I hoped I am still new to Elixir, so can’t really judge ...
New

Other popular topics Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 49266 226
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New

We're in Beta

About us Mission Statement