[erlang-questions] erlang:monitor() lag time: how long to expect?

Scott Lystig Fritchie <>
Thu May 15 02:30:29 CEST 2008

Hi, I've discovered that the lag time between calling erlang:monitor()
and receiving the {'DOWN', ...} message.  I'd like to ask how long is
reasonable to wait?

The proc I'm monitoring is on a remote node, and I'm monitoring it via
erlang:monitor(process, {registered_name_atom(), node_atom()}).  I have
two Erlang nodes, A & B, on two separate physical machines.  Both are
running R11B-5 on top of Linux, "erl -kernel net_ticktime 60 ...".

   1. B is quite busy doing stuff, but it's responding to
      gen_server:call() queries within the default 5 seconds.

   2. On A, I call monitor/2 for a process, my_server_proc, that hasn't
      started yet on B.

   3. 31 seconds later, B starts & registers the proc I want to monitor

   4. 32 seconds later, A gets a {'DOWN', ...} message for step #2's

I suppose I shouldn't be monitoring a proc that hasn't been started
yet.  ("Doctor, it hurts when ...")  And there's a work-around, I
suppose: use rpc:call(node_B, erlang, whereis, [my_server_proc]) to
verify that the server is actually running.

Has anyone else run into seemingly long-delayed {'DOWN', ...} messages?


--- snip --- snip --- snip --- snip --- snip --- snip ---

node A : 20080514162806 : make_monitor 1: {my_server_proc,''} ref #Ref<>

node B : 20080514162837 : progress: [{supervisor,{local,foo_foo_sup}},{started,[{pid,<0.324.0>},{name,my_server_proc},{mfa,{foo_server,start_link,...

node A : 20080514162857 : gen_server:call({my_server_proc,''}, bar) returned ok

node A : 20080514162909 : got 'DOWN': my_server_proc Mref #Ref<>, Type process, Object {my_server_proc,''}, Info noproc

More information about the erlang-questions mailing list