[erlang-questions] My frustration with Erlang

Joel Reymont <>
Sat Sep 13 23:15:41 CEST 2008


On Sep 13, 2008, at 9:56 PM, Edwin Fine wrote:

> Here's the stupid idea: Run one +S 1 VM per core instead of N +S N  
> VMS.
> [...]
> What do you think? Is the newbie smoking something, or is there maybe
> something to it?


There's definitely something to it and I'll try it just as soon as I'm  
able to make my test harness a distributed one. It's designed to  
launch everything on a single node right now.

There's something that's nagging at me as well, which is why I haven't  
been in a rush to rewrite the test harness. I want to know why my  
gen_server calls start to timeout!

I even killed the VM upon the first timeout to get a crash dump. Lo  
and behold, there were no processes with lengthy message queues. The  
distribution among the 21234 processes goes like this:

0, 1, 2, 3, 4, 5, 6, 7 (20), 8 (18), 9 (28), 10 (36), 11 (19), 12  
(24), 13 (8), 14 (8), 15, 26, 32, 33

The # of processes with this queue length is in parenthesis and is 1  
where there are none. Perhaps I should pay attention to the counts  
over 5 or 10.

The complication is that most of the gen_servers look like this in the  
crash dump...

=proc:<0.4093.0>
State: Waiting
Spawned as: proc_lib:init_p/5
Spawned by: <0.4001.0>
Started: Sat Sep 13 18:36:39 2008
Message queue length: 0
Number of heap fragments: 0
Heap fragment data: 0
Link list: [#Port<0.5677>]
Reductions: 3422
Stack+heap: 2584
OldHeap: 377
Heap unused: 1800
OldHeap unused: 377
Program counter: 0x0000000144d3c748 (gen_server:loop/6 + 288)
CP: 0x0000000144cfe458 (proc_lib:init_p/5 + 400)
arity = 0

Note that the current function is gen_server:loop/6, they were  
(obviously) spawned by proc_lib:init_p/5 and the processes are unnamed.

There's more info in the crash dump on every process, e.g. process  
dictionary, stack and heap (below). I'm able to deduce that this is a  
bot process but I'm still scratching my head over jumping from this to  
identifying the gen_server timeouts.

=proc_dictionary:<0.4093.0>
H10B4D30
H10B4D48
=proc_stack:<0.4093.0>
0x000000015e0fc498:SReturn addr 0x44CFE458 (proc_lib:init_p/5 + 400)
y0:N
y1:A8:infinity
y2:A3:bot
y3:H5E0F8C30
y4:P<0.4093.0>
y5:P<0.4093.0>
0x000000015e0fc4d0:SReturn addr 0x1A9D28 (<terminate process normally>)
y0:SCatch 0x44CFE478 (proc_lib:init_p/5 + 432)
y1:A3:gen
y2:A7:init_it
y3:H10B4D20
=proc_heap:<0.4093.0>
5E0F8C30 
:tD:A3 
:bot 
,H10B4DB0,I14,I3,p<0.5677>,H10B4FA0,N,I1150,I2,I797372250,A5:false,I1,I0
10B4FA0:lA5:CHECK|H10B4FB0
10B4FB0:lA5:CHECK|H10B4FC0
10B4FC0:lA4:FOLD|H10B4FD0
10B4FD0:lA3:nil|N
10B4DB0:YhE:6B6D616E2F373937333732323530
10B4D20:lAA:gen_server|H10B4DE8
10B4DE8:lP<0.4001.0>|H10B4E48
10B4E48:lA4:self|H10B4E88
10B4E88:lA3:bot|H10B4EC0
10B4EC0:lH10B4EE0|H10B4EF0
10B4EE0:lH10B4DB0|H10B4F10
10B4F10:lI797372250|H10B4F30
10B4F30:lI2|H10B4F50
10B4F50:lI1160|N
10B4EF0:lN|N
10B4D30:t2:AD:$initial_call,H10B4DF8
10B4DF8:t3:A3:gen,A7:init_it,H10B4D20
10B4D48:t2:AA:$ancestors,H10B4E18
10B4E18:lP<0.4001.0>|H10B4E58
10B4E58:lP<0.37.0>|N


--
wagerlabs.com








More information about the erlang-questions mailing list