How to pass erl custom parameters for Phoenix app?

My Phoenix application falls within the Erlang VM max process limit, what is the best way to specify user-defined parameters for erl (e.g. + P) for a specific Phoenix application (or even better, only for MIX_ENV = PROD)? Is there a way to do this through application configuration files? Or, if not, maybe when I run "mix phoenix.server"?

+5
source share
1 answer

You can use elixir to start the application using the --erl flag:

 elixir --erl "+P 10000000" -S mix phoenix.server 

If you want to use a shell, you can use iex instead:

 iex --erl "+P 10000000" -S mix phoenix.server 

Here is a copy of using the elixir command.

Usage: elixir [options] [.exs file] [data]

-v Print version and outputs
-e "command" Evaluate the given command ()
-r "file" Specified files / templates required ()
-S "script" Finds and executes the given script
-pr "file" Requires these files / templates in parallel ()
-pa "path" Prepares the given path to the path of the Erlang () path
-pz "path" Adds the given path to the Erlang code () path
--app "app" Run this application and its dependencies ()
--erl "switch" Switches are passed to Erlang (*)
--name "name" Makes and assigns a name to the distributed node
--sname "name" Makes and assigns a short name to a distributed node
--cookie "cookie" Sets cookies for this distributed node.
--hidden makes a hidden node
--detached Starts the remote Erlang console from the console
--werl Uses the Erlang shell GUI for Windows (Windows only)
--no-halt Erlang VM does not shut down after execution

** Parameters marked with (*) can be set more than once
** Parameters specified after the .exs file or - are transferred to the executable code

** Parameters can be passed at Erlang runtime using ELIXIR_ERL_OPTIONS or --erl

If you use exrm , you can also provide this in the vm.args file https://hexdocs.pm/exrm/release-configuration.html

+9
source

Source: https://habr.com/ru/post/1245812/


All Articles