Running multiple Erlang applications. One or many VMs?

三世轮回 提交于 2020-01-13 08:31:07

问题


I want to run multiple Erlang applications, one being Riak and another being a web server. Should I run them in the same of separate Erlang VMs and why?


回答1:


If they don't have to do anything with each other: No. You might need to restart the VM for one of the applications, which would result in a downtime for both.




回答2:


While many would recommend decoupling these subsystems I would take the opposite approach. Erlang has a built in strategy to run many applications on the same release. If your applications talk to each other directly it might make sense for you to bundle them together into a release. This will make calls between the applications faster. Some will argue that all you applications now share the same fate should you need to take the system down for an upgrade that only one of the applications needs. This is a moot point with Erlang where you are distributing your applications across many nodes. Also most upgrades can be done with hot code loading.




回答3:


It is called "fate sharing", a common design decision. The more sub-systems share common resources, the more their "fate" are tied together. In the event of malfunction/failure, the more "fate sharing" --> the increased likelihood of systematic failure.

IF you can have each in separate VMs then I would say it is better this way.




回答4:


By using separate VMs you lose a lot of erlang benefits.



来源:https://stackoverflow.com/questions/2194997/running-multiple-erlang-applications-one-or-many-vms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!