[erlang-questions] EPMD question
Patrik Nyblom
pan@REDACTED
Thu Aug 1 11:57:24 CEST 2013
Hi!
On 07/31/2013 01:24 PM, Erlang Tech wrote:
>
> Good day everyone
>
> we are noting and interesting situation on one of our servers. We
> have an erlang cluster with the application distributed over multiple
> servers.
>
> When we do a netstat we see a lot of the following on one specific server:
>
> tcp 0 0 10.27.103.12:epmd 10.27.103.80:52873
> TIME_WAIT
> tcp 0 0 10.27.103.12:epmd 10.27.103.80:48273
> TIME_WAIT
> tcp 0 0 10.27.103.12:epmd 10.27.103.80:38921
> TIME_WAIT
> tcp 0 0 10.27.103.12:epmd 10.27.103.80:59294
> TIME_WAIT
> tcp 0 0 10.27.103.12:epmd 10.27.103.80:58333
> TIME_WAIT
>
> 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,
> to communicate between the two epmd server instances.
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:
Host a.com:
1 EPMD instance (a)
Erlang node foo@REDACTED
Erlang node bar@REDACTED
Host b.com:
1 EPMD instance (b)
Erlang node foo@REDACTED
EPMD (a), at a.com knows about 'foo' and 'bar' on a.com
EPMD (b), at b.com knows about 'foo' at b.com
When node foo@REDACTED wants to connect to foo@REDACTED, it splits the Erlang
nodename (foo@REDACTED) 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 bar@REDACTED, 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).
The Erlang nodes however have persistent connections to their *local*
EPMD (i.e. foo@REDACTED 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.
So, in short, what you see is normal.
>
> The one server has 4 erlang nodes running, and the other server has a
> single erlang node running (mostly yaws).
>
> Erlang version R14B03.
>
> Thank you
>
>
Cheers,
Patrik
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130801/3698b9b5/attachment.htm>
More information about the erlang-questions
mailing list