gpt4 book ai didi

elixir - 如何通过Phoenix应用程序的自定义erl选项?

转载 作者:行者123 更新时间:2023-12-04 13:26:20 26 4
gpt4 key购买 nike

我的Phoenix应用程序达到了Erlang VM的最大进程限制,什么是为特定Phoenix应用程序指定erl(如+ P)自定义选项的最佳方法(甚至更好,仅针对MIX_ENV = PROD)?有没有办法通过应用程序的配置文件来执行此操作?或者,如果没有,也许当我运行“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中提供它

关于elixir - 如何通过Phoenix应用程序的自定义erl选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36232480/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com