[erlang-questions] Erlang shell crashes

Sean Hinde sean.hinde@REDACTED
Thu Oct 26 12:13:54 CEST 2006


On 26 Oct 2006, at 10:38, Surindar Sivanesan wrote:

> Also, I need to know about the term Reductions.
> What does it mean?
> Is it should be minimum or maximum for better performance? (How is  
> it measured?)

Reductions is approx equivalent to the number of function calls that  
the process has ever executed.

>
>
> On 10/26/06, Surindar Sivanesan <surindar.shanthi@REDACTED> wrote:
> From the crash dump viewer, I have noticed that the stack+heap size  
> and message queue lenght are high for some processes.
>
> PidName/Spawned asStateReductions Stack+heap MsgQ Length
> <0.128.0>controling_processWaiting16244666610946380465
> <0.60.0> logwriterGarbing (limited info)1254909993416095272345
>
> Here, the logwriter uses ODBC connectivity and write the log to MS  
> SQL DB.
> All the other process in this application uses logwriter process to  
> write log.

The problem here is that you are sending async messages to the  
logwriter faster than it can process them. One simple fix could be to  
make the requests to the logwriter syncronous (i.e. use  
gen_server:call() )

A more sophisticated solution could be to collect chunks of messages  
to be logged until a few hundred are collected and then spawn a  
process to write them. That way the gen_server:call from all the  
other processes will never have to wait for disk.

Allowing a process to collect huge message queues is one sure way to  
kill the performance of the whole system - far worse than the  
overhead of using gen_server:call in such situations.

I have been persuaded that this is not because of message queue  
traversals, but instead is some artifact of having huge live datasets  
on the message queue for the garbage collector to deal with.

Sean






More information about the erlang-questions mailing list