Elixir on AWS Lambda

Just to extend the options you named, there is also Iron Worker which works quite similar to the mentioned cloudfunctions:


With IronWorker you have more power on the environment where your code runs in using Docker.

There are some options :slight_smile:

Example app in Java


Any news about this?


I have a prototype up here: https://github.com/jschoch/exlam

I’m working on another project to test it with and hope to make some improvements after I get something else working.


I don’t see Erlang mentioned as a supported language on AWS lambda docs page. Please explain!
What is the workaround or is Erlang now supported!?

1 Like

First I am not convinced that elixir/erlang is good for short running process which aws lamda is.
There are many workarounds to run not supported languages:

You can pack elixir in docker container

You can run any executable

I think Go language uses NodeJS Wrapper hack


Can you elaborate on the downsides? What makes elixir not well suited for lambda? If you boot the erlang VM in the node.js module initialization it is plenty fast and you can avoid the VM boot tax. I can get < 10ms response times with my prototype.

The upsides are that you can use elixir’s great syntax, and you don’t have to pay for a server waiting around for stuff to do for spiky workloads or very low transaction rates. the HA of Lambda is a big win not to mention avoiding all the hassle of updating/patching another set of server’s operating systems.


Yes I mean you need to spin up elrang VM. Ok but if boot the erlang VM in the node.js module initialization works fast …


Host AWS lamda by your self :slight_smile:


It would be cool to have Elixir working on Lambda because of cost saving, but the high available nature of Erlang does not make it best fit for this architecture.

We recently released the open-source SCAR framework that can run containers out of Docker images on AWS Lambda. We have included an use case to run Elixir code in AWS Lambda, just as a proof of concept of supporting programming languages (and runtime environments) other than those officially supported by AWS Lambda. Just in case you may be interested.


What about the max execution time of a lambda function? as its not unlimited, then it will be impossible to have a living elixir process, right?

This is true. Lambda while cool negates some of the benefits you get from running elixir.

1 Like

A bit of an old thread, but apparently an announcement was made at reinvent that support is coming (or was just made available). https://blog.alertlogic.com/new-runtimes-provided-by-alert-logic-widen-the-playing-field-for-aws-lambda/

Above is the reinvent announcement and the foundation of the Alert Logic offerings. Alert Logic is a partner that is leveraging the new Lambda Runtime API to deliver a packaged solution for Elixir. I would assume that layers can be leveraged in the future for common libs and features. Similar to how deep learning python packages were deployed to assist python lambdas with deep learning tasks. What would be nice layers for Elixir? Ecto? The Elixir based deep learning Tensorflow bindings?

Lambdas can also now be fronted directly by a public HTTP(s) load balancer. So check that out too. (although if you’re handling a lot of requests, it will still likely be cheaper not to use lambda).

We also have a thread specifically about the announcement of “official” lambda support: Elixir on AWS Lambda is coming soon


What I don’t understand is:
Isn’t one of elixirs big features that it can trigger subprocesses easily to a whole cluster of elixir mashines and if one of the nodes fails its not a deal at all and the process is taken over by another node?
Wouldn’t that feature be completely lost? I understand that Lambda provides all sorts of mechanisms to deal with concurrent calls and also infrastructure for dealing with failures … isn’t the only advantage left a nicer syntax and maybe a more stable eco system?

That is true but with the traditional Elixir way you need to have a server, or a cluster, that is able to handle traffic peaks. So you get this costly machine that has some CPUs and some GBs of RAM, but most of the time it runs for nothing.

With serverless you only use machines when required, and it “automatically” scales with huge traffic peaks.

That being said I am not working on such successful app so for me a persistent running server is good enough and allows to benefit from all Elixir and BEAM features.

Is there a way to warmup Elixir with AWS ? I mean the VM has slow startup times (compared to a simple PHP script or a JS lambda that will start executing code almost instantly).

1 Like

Yes, there is a way … in the past you would use the serverless-warmup plugin in case you use serverless framework. That would spin another funtion calling your function every 5 minutes.
But AWS has a build in feature now, a simple flag provisionedConcurreny={n}.
This will make sure that you always have {n} amounts of lambdas ready and warm.

(also available in never serverless framework versions)
I am not 100% sure if that also means that the BEAM is always ready as well since it runtime is on a diffent layer, but I assume it would.
Let us know if it works.