Pass erlang VM options to mix phx.server

Im trying to tweak some setting on the erlang VM and I found a way locally to start the server with --erl options like this ‘iex --erl “+stbt ns” -S mix phx.server’ however in production we just start our server with mix phx.server and don’t use the iex part. I also saw something that was saying you can do ‘elixir --erl “+stbt ns” -S mix phx.server’ , but this caused our app to not start properly do to something blowing up inside redis. Is there a way I can set an ENV variable or add something to my mix.exs to accomplish this?

Is there a reason you are using mix to run your production application? It is really more of a dev tool. You may want to consider generating releases for your application(s).

2 Likes

To expand on this, popular tools like Distillery offer direct programmatic hooks for managing your vm.args:

https://hexdocs.pm/distillery/config/vm.args.html

2 Likes