<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Well a common problem is to have the process also blocked on its own
synchronous call, so that can keep the CPU usage low, since it is
spending time mostly idle waiting for 1 or more responses from some
other processes. The best way I have seen to deal with this type of
timeout problem is to always pass the timeouts in the message like
this:<br>
gen_server:call(<process>, {<message>, Timeout - DELTA},
Timeout)<br>
Where DELTA can be 100 milliseconds. Then the (Timeout-DELTA) value
the handle_call sees can be used for any internally synchronous
calls. However, then the problem becomes understanding what the
cumulative delay might be, if there are multiple synchronous calls
used within the process. Ideally, the process is kept simpler, so
it doesn't need to try and track many synchronous calls.<br>
<br>
I am not entirely sure if this is your problem, since it could be
latency due to function calls too, if function calls are blocking
schedulers or something strange, code loading locking schedulers.
Usually those issues aren't as common a concern though.<br>
<br>
On 10/11/2012 10:05 PM, Code Box wrote:
<blockquote
cite="mid:CAOZAnVPkQOsLbRqPK3rgnEEV7+N8XymYk2v6ZycicH9_95cYOw@mail.gmail.com"
type="cite">
<meta http-equiv="Context-Type" content="text/html;
charset=ISO-8859-1">
Will it not relate to any CPU Stats of my host and also any memory
stats of my host that the process is overloaded ? I see CPU %
usage as just 50% ?<br>
<br>
<div>On Thu, Oct 11, 2012 at 9:14 PM, Michael Truog <span><<a
moz-do-not-send="true" href="mailto:mjtruog@gmail.com">mjtruog@gmail.com</a>></span>
wrote:<br>
<blockquote>
<div>
<div>
<div> On 10/11/2012 09:03 PM, Code Box wrote:
<blockquote type="cite">
<div>** Reason for termination ==</div>
<div>** {timeout,{gen_server,call,[thetime,gettime]}}</div>
<div><br>
</div>
<div>=CRASH REPORT==== 2012-10-09 05:37:04 UTC ===</div>
<div> crasher:</div>
<div> initial call:
process_listener:-init/1-fun-2-/0</div>
<div> pid: <0.12376.513></div>
<div> registered_name: []</div>
<div> exception exit:
{timeout,{gen_server,call,[thetime,gettime]}}</div>
<div> in function gen_server:terminate/6</div>
<div> ancestors:
[incoming_req_processor,incoming_sup,top_process_sup,</div>
<div> <0.52.0>]</div>
<div> messages: []</div>
<div> links: []</div>
<div> dictionary:
[{random_seed,{23375,22820,17046}}]</div>
<div> trap_exit: true</div>
<div> status: running</div>
<div> heap_size: 6765</div>
<div> stack_size: 24</div>
<div> reductions: 1646842</div>
<div> neighbours:</div>
<div><br>
</div>
<div>I am seeing a lot of these messages in my Crash
Reports. Once this reaches this it goes into this
crash loop for quite a while. I am not sure how to
debug this error. These timeouts are really
annoying. Can some one help me understand the root
cause of this?</div>
<div><br>
</div>
<div>Why does my genserver calls are facing timeouts ?
Is it that my erlang VM is slow if so why ? How can
i debug this issue to get to the root cause of it ? </div>
<div><br>
</div>
</blockquote>
</div>
</div>
If you look at gen_server:call/2 at <a
moz-do-not-send="true"
href="http://www.erlang.org/doc/man/gen_server.html">http://www.erlang.org/doc/man/gen_server.html</a><br>
it shows the default Timeout is 5000 milliseconds (5
seconds). Your gen_server process must have been processing
for longer than 5 seconds while a gen_server:call/2 message
was waiting in the process message queue, to cause the
timeout exception. So, it isn't the Erlang VM being slow,
it is just an Erlang process that is overloaded (i.e., the
"thetime" registered process).<br>
<br>
<br>
<br>
</div>
</blockquote>
</div>
<br>
</blockquote>
<br>
</body>
</html>