Hi, I’m testing out adding Phoenix into our mix at work, and am starting off by having it do some read services for our move from a big monolith to a more distributed CQRS set of services. So at first all it’s going to be doing is returning a pre-rendered json payload, stored in a materialized view. In order to justify bringing Elixir to our stack, I need to come up with some numbers, so I’m planning on load testing various options for our read services. My question is: what’s the minimum sensible deployment for this simple app such that when I load test it, I’m getting realistic numbers? We deploy on EC2 instances on AWS, and the read cache is in MySQL for now.
Thanks for the input. Can anyone shed more light on what the minimal proper way to be serving it is on the server? In my case the service will only be hit from an API gateway service, so I don’t need sessions or authentication or anything, it will be locked down on a private network.
As I said if you don’t need sessions or authentication start with Plug with Cowboy and you’'ll have a minimal setup. You can start with an empty project:
mix new my_project and then add those libraries to mix.exs
The only thing I’ve tried so far is serving the app using mix phx.server. As I have no assets to bundle or serve differently, maybe that’s sufficient? What I want to avoid is getting bunk data from my load test comparison because I tested the elixir process with it “deployed wrong”, so it’s a bit of a case of me not knowing what I don’t know. I looked over the phoenix doc deployment pages, but they seems slanted at deployments for much for involved sites (or maybe I’m just wrong!)
Is simply installing on a small EC2 box and making an ubuntu service that fires up “mix phx.server” and acceptable and realistic way of serving on a simple site?
For testing your usecase it’s probably ok to start mix phx.server, but for production you should always use proper mechanisms that also blend into your processes.
Also in general destillery is nice in this regard, as you can build self contained archives with it. You then do not need to install Erlang and elixir on your server, but only drop the release and run it.