thank you so much for this feedback<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Nov 14, 2012 at 6:14 PM, Konstantin Tcepliaev <span dir="ltr"><<a href="mailto:f355@f355.ru" target="_blank">f355@f355.ru</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Hi,</div><div> </div><div>A1: Using rpc:call/4 is definitely a worst choice, as it uses a call to {Name, Node} with extra overhead and single registered process. HTTP implies lots of overhead too. I'd go with {Name, Node} ! Msg.</div>
<div>A2-3: Suggested in A1 method can be improved by some (not so) clever usage of erlang:monitor/2 and message passing, so that your sending node knows whether remote registered process is alive or not, and behaves accordingly.</div>
<div> </div><div>Regards,</div><div>--</div><div>Konstantin </div><div>09.11.2012, 09:20, "Joshua Muzaaya" <<a href="mailto:joshmuza@gmail.com" target="_blank">joshmuza@gmail.com</a>>:</div><blockquote type="cite">
<div><div class="h5"><br clear="all"><div><p>I have a setup in which two nodes are going to be communicating a lot. On Node A, there are going to be thousands of processes, which are meant to access services on Node B. There is going to be a massive load of requests and responses across the two nodes. The two Nodes, will be running on two different servers, each on its own hardware server.<br>
<br></p><p>I have 3 Options: HTTP/1.1 , rpc:call/4 and Directly sending a message to a registered gen_server on Node B. Let me explain each option.<br><br> <strong>HTTP/1.1</strong><br><br> Suppose that on Node A, i have an HTTP Client like <code>Ibrowse</code>, and on Node B, i have a web server like <code>Yaws-1.95</code>, the web server being able to handle unlimited connections, the operating system settings tweaked to allow yaws to handle all connections. And then make my processes on Node A to communicate using HTTP. In this case each method call, would mean a single HTTP request and a reply. I believe there is an overhead here, but we are evaluating options here. The erlang Built in mechanism called <code>webtool</code>, may be built for this kind of purpose. <br>
<br> <strong>rpc:call/4</strong><br><br> I could simply make direct rpc calls from Node A to Node B. I am not very sure how the underlying rpc mechanism works , but i think that when two erlang nodes connect via <code>net_adm:ping/1</code>, the created connection is not closed but all rpc calls use this pipe to transmit requests and pass responses. Please correct me on this one.<br>
<br><strong>Sending a Message from Node A to Node B </strong><br><br> I could make my processes on Node A to just send message to a registered process, or a group of processes on Node B. This too seems a clean option. <br>
<br> <strong>Q1.</strong> Which of the above options would you recommend and why, for an application in which two erlang nodes are going to have enormous communications between them all the time. Imagine a messaging system, in which two erlang nodes are the routers :) ?<br>
<br> <strong>Q2.</strong> Which of the above methods is cleaner, less problematic and is more fault tolerant (i mean here that, the method should NOT have single point of failure, that could lead to all processes on Node A blind) ? <br>
<br><strong>Q3.</strong> The mechanism of your choice: how would you make it even more fault tolerant, or redundant? <br><br> <strong>Assumptions: </strong> The Nodes are always alive and will never go down, the network connection between the nodes will always be available and non-congested (dedicated to the two nodes only) , the operating system have allocated maximum resources to these two nodes.<br>
<br> Thank you for your evaluations</p></div><br><br><br><br></div></div><div class="im">,<p>_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a></p></div></blockquote></blockquote></div><br><br clear="all"><br>-- <br>*Muzaaya Joshua<br>
Systems Engineer<br>+256774115170*<br>*"Through it all, i have learned to trust in Jesus. To depend upon His Word"<br>*<br><br><br><br>
</div>