<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi!<br>
On 07/31/2013 01:24 PM, Erlang Tech wrote:<br>
</div>
<blockquote
cite="mid:1375269893.10059.0.camel@greyowl.thebluegroup.co.za"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="GENERATOR" content="GtkHTML/4.6.5">
<br>
Good day everyone<br>
<br>
we are noting and interesting situation on one of our servers. We
have an erlang cluster with the application distributed over
multiple servers. <br>
<br>
When we do a netstat we see a lot of the following on one specific
server:<br>
<br>
tcp 0 0 10.27.103.12:epmd
10.27.103.80:52873 TIME_WAIT <br>
tcp 0 0 10.27.103.12:epmd
10.27.103.80:48273 TIME_WAIT <br>
tcp 0 0 10.27.103.12:epmd
10.27.103.80:38921 TIME_WAIT <br>
tcp 0 0 10.27.103.12:epmd
10.27.103.80:59294 TIME_WAIT <br>
tcp 0 0 10.27.103.12:epmd
10.27.103.80:58333 TIME_WAIT<br>
<br>
my question is what could be causing this multitude of connections
to epmd from that one specific server. My understanding was that
epmd would only require a single connection, <br>
to communicate between the two epmd server instances.<br>
</blockquote>
No, each Erlang node connects to a remote epmd on a machine where a
remote Erlang node resides in the distribution connection phase.
Like this:<br>
<br>
Host a.com:<br>
1 EPMD instance (a)<br>
Erlang node <a class="moz-txt-link-abbreviated" href="mailto:foo@a.com">foo@a.com</a><br>
Erlang node <a class="moz-txt-link-abbreviated" href="mailto:bar@a.com">bar@a.com</a><br>
<br>
Host b.com:<br>
1 EPMD instance (b)<br>
Erlang node <a class="moz-txt-link-abbreviated" href="mailto:foo@b.com">foo@b.com</a><br>
<br>
EPMD (a), at a.com knows about 'foo' and 'bar' on a.com<br>
EPMD (b), at b.com knows about 'foo' at b.com<br>
<br>
When node <a class="moz-txt-link-abbreviated" href="mailto:foo@b.com">foo@b.com</a> wants to connect to <a class="moz-txt-link-abbreviated" href="mailto:foo@a.com">foo@a.com</a>, it splits the
Erlang nodename (<a class="moz-txt-link-abbreviated" href="mailto:foo@a.com">foo@a.com</a>) into the name and host parts (foo and
a.com), looks up the ip address for a.com, connects to the EPMD port
on a.com and asks for 'foo'. EPMD gives it a port number and it
connects to that port on a.com. If it then wants to connect to
<a class="moz-txt-link-abbreviated" href="mailto:bar@a.com">bar@a.com</a>, the process is repeated, but it asks EPMD (a) for 'bar'
and gets another port number. The questions to EPMD uses temporary
connections, so for each question, a tcp TIME_WAIT connection will
linger (as always in TCP). Note that the peer (the one asking) has
used ephemeral ports, so as long as the frequency is not high enough
to exhaust the ephemeral ports on 10.27.103.80, this is no problem.
The TIME_WAIT connections will disappear in approx 4 minutes
(2*MSL).<br>
<br>
The Erlang nodes however have persistent connections to their
*local* EPMD (i.e. <a class="moz-txt-link-abbreviated" href="mailto:foo@b.com">foo@b.com</a> has a connection to EPMD (b) for the
whole lifetime of the node), but that is a trick for EPMD to know
when the Erlang node dies. That connection is of course also used to
communicate the nodename (i.e. 'foo') to EPMD when registering, but
after that it's silent and only used for supervision.<br>
<br>
So, in short, what you see is normal.<br>
<blockquote
cite="mid:1375269893.10059.0.camel@greyowl.thebluegroup.co.za"
type="cite">
<br>
The one server has 4 erlang nodes running, and the other server
has a single erlang node running (mostly yaws).<br>
<br>
Erlang version R14B03.<br>
<br>
Thank you<br>
<br>
<br>
</blockquote>
Cheers,<br>
Patrik<br>
<blockquote
cite="mid:1375269893.10059.0.camel@greyowl.thebluegroup.co.za"
type="cite">
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
erlang-questions mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a>
</pre>
</blockquote>
<br>
</body>
</html>