[erlang-questions] error_logger and the perils of asynchronicity
Oscar Hellström
oscar@REDACTED
Fri May 15 00:55:04 CEST 2009
Steve Davis wrote:
> I'm pretty sure the messaging backup is caused by the absolutely
> necessary use of io:format in the standard error_logger/
> error_logger_file_h.
>
> I'm sure that nobody can have missed that io:format even to tty is the
> just about the slowest component of any application.
Yes. But regardless if a process is overloaded with work or not, sending
it too many messages at the same time will explode its heap. With enough
processes running at the same priority level, it will have a hard time
keeping up and consuming those messages.
> Maybe (just a suggestion) the answer is to install a custom log
> handler that writes the entries to a memory cache (ets) then run
> another process that works down the table of entries and writes it out
> to disk at its own pace?
Ah, but in this case, in the event of a system failure (which results in
the VM crashing from running out of memory) we still wouldn't know what
should have been logged.
> regs,
> Steve
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
--
Oscar Hellström, oscar@REDACTED
Office: +44 20 7655 0337
Mobile: +44 798 45 44 773
Erlang Training and Consulting Ltd
http://www.erlang-consulting.com/
More information about the erlang-questions
mailing list