如何为 Phoenix 应用程序传递自定义 erl 选项?

How do pass custom erl options for a Phoenix app?

我的 Phoenix 应用程序达到了 Erlang VM 的最大进程限制,什么是为特定 Phoenix 应用程序(甚至更好,仅适用于 MIX_ENV 指定 erl(如 +P)自定义选项的最佳方法=产品)?有没有办法通过应用程序的配置文件来做到这一点?或者如果没有,也许当我 运行 "mix phoenix.server"?

您可以使用 elixir 到 运行 带有 --erl 标志的应用程序:

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

如果您想要 shell,您可以使用 iex

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

这是 elixir 命令用法的副本。

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

-v Prints version and exits
-e "command" Evaluates the given command ()
-r "file" Requires the given files/patterns (
)
-S "script"   Finds and executes the given script
-pr "file" Requires the given files/patterns in parallel ()
-pa "path" Prepends the given path to Erlang code path (
)
-pz "path" Appends the given path to Erlang code path ()
--app "app" Start the given app and its dependencies (
)
--erl "switches" Switches to be passed down to Erlang (*)
--name "name" Makes and assigns a name to the distributed node
--sname "name" Makes and assigns a short name to the distributed node
--cookie "cookie" Sets a cookie for this distributed node
--hidden Makes a hidden node
--detached Starts the Erlang VM detached from console
--werl Uses Erlang's Windows shell GUI (Windows only)
--no-halt Does not halt the Erlang VM after execution

** Options marked with (*) can be given more than once
** Options given after the .exs file or -- are passed down to the executed code
** Options can be passed to the Erlang runtime using ELIXIR_ERL_OPTIONS or --erl

如果您使用 exrm,那么您也可以在 vm.args 文件中提供 https://hexdocs.pm/exrm/release-configuration.html