Erlang: remote call vs sending messages

后端 未结 2 682
耶瑟儿~
耶瑟儿~ 2021-02-09 20:13

I\'d like to execute some procedure on a remote node. And I\'m not sure which is the best way to do this. I can write a rpc:call to do this. Or send a message by

2条回答
  •  囚心锁ツ
    2021-02-09 20:39

    rpc seems to be comprehensive solution, but it has some disadvantages related to scale. rpc uses single 'rex' server to cross node communication and potentially it may be overwhelmed. If you go with rpc, you should monitor this process.

    If the communication is the main functionality and it is the top of io/cpu/memory consumer I would consider writing it yourself. On the other hand we may expect improvements from OTP team (and pre-mature optimization is root of all evil!!!).

提交回复
热议问题