jschoch
I did a few experiments with running on lambda via exrm because I wanted to avoid writing .js as much as possible. Here is what I found.
- the invocation time is slow for 128MB ram, need to make sure you have enough ram since ram and CPU are proportional. 128MB execution time is ~ 2-4 seconds.
- permissions are tricky due to the .erlang.cookie and the deployment model. I was only able to get one piece working by setting it to
nocookie. You have to be aware that one user puts your files into the container, and your invocation user may be random. - exrm seems to nicely bundle up libs and dependencies for a basic app. No mucking around with LD_LIBRARY_PATH was needed.
- deploying less to /var/task (where your zipped files go by default) is the best way to manage permissions. You can’t change these files after they are deployed to this root, but you can deploy a dir with 777 permissions and then chmod it later.
- you have to set a HOME env var for each possilbe invoker or erlang will complain. This where .erlang.cookie ends up living and you never know who will invoke. Since erlang.cookie needs something like permistions of 700 or 500 your processes will crash with file access problems.
wondering if others are interested in this
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
New
Kia ora,
We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
I’ve followed the Phoenix LiveView file upload code here Uploads — Phoenix LiveView v1.0.0-rc.7 and so far everything works just fine wit...
New
I’m using an Umbrella project for a Phoenix application, and I want to have one Ecto Repo and one PostgreSQL database shared by all apps....
New
Hello,
I’m developing a online persistent chat system (what’s app) like using elixir/dynamodb/aws for a mobile app(flutter).
The diffic...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #ai
- #phoenix_html
- #iex
- #graphql
- #elixirconf-us
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
Hoegbo
Interesting stuff AWS Lambda is news to me. I am interested now. Will look into this if it could work for us
mkunikow
Hmm interesting. So you executing external elixir process through child node module process?
I am wondering how the speed/performance/monitoring … compare to pure nodejs application.
PS
If you don’t like javascript you can write i purescript Purescript on AWS Lambda
jschoch
i have a phoenix server running and i’m quite pleased with the results. Base invocation time for starting elixir via escript is around 180ms, but since you can now keep something around, although frozen, for 5 minutes invoking a server on lambda makes much more sense. This saves you a ton of time and expense for lambda.
The below client/server takes between 11 and 20 ms to run with 1024MB ram lambda.
server
client
I’ll test with a native node.js http request in a few. should be faster…
jschoch
to add some context here, this means you can run ~100,000 invocations, or phoenix requests, for around $.04 per month in a highly available environment where you can forget about load balancers, patches, ssh keys, etc etc etc.!
mkunikow
Yes I totaly agree - the future is lamda architecure
There are also:
But I don’t know if you can run elixir there.
mgwidmann
Maybe someone can explain to me because I don’t get it.
Why use AWS lambda when Elixir can just start a supervised task and perform your work for you? What kind of work would AWS lambda be better for where a lightweight process doesn’t fit better?
jschoch
i suppose the biggest benefit for me is that the server goes away and I can continue to use elixir.
Let’s say I want to process a file. Old way: i setup a server and let it run for ever waiting for some request. New way. someone dumps a file in an S3 bucket which generates an event that starts my lambda function and processes the file. I’ve just removed all the muck associated with maintaining a server (or 2 or 3 if you need HA) for a trivial task. I really don’t want to think about certs and load balancers, and patches, and security 0days, not to mention the expense of having 2 of everything. Lambda is essentially devops in a box, scaling, HA, all taken care of for literally pennies.
mkunikow
This is not easy task what AWS lamda can do :). You can run the same code on one machine and 1000 machines if needed depends on load. But as developer you don’t care where it runs and how many machines you will need.
The best part you only pay for work AWS lamda do for you , not machines you use for it.
The drawback you need to keep state somewhere else also there is limit how long computation can be executed (I suppose there is 5 minutes)
seb5law
Just to extend the options you named, there is also Iron Worker which works quite similar to the mentioned cloudfunctions:
https://www.iron.io/platform/ironworker/
With IronWorker you have more power on the environment where your code runs in using Docker.
mkunikow
There are some options
…
Example app in Java
https://www.voxxed.com/blog/2017/01/aws-iot-button-lambda-couchbase/