Logger under load

Michael Truog mjtruog@REDACTED
Fri Aug 7 20:08:27 CEST 2020


On 8/7/20 5:25 AM, Michael Uvarov wrote:
> Hi,
>
> Sync/async logging was a common issue with lager too. I highly suggest 
> not to use sync logging to avoid extra timeout issues which is pretty 
> hard to debug.
>
> Dropping the whole sinks (the whole pending logger message queue) was 
> an option for lager.
>
> Better option would be to count how many events are logged from each 
> location and start skipping log events from too chatty locations (and 
> log how many events were dropped accordingly). But I haven't seen such 
> "smart" code anywhere yet.

That is a good situation to use the process dictionary for determining 
which Erlang processes are attempting to overload the logger.  Also, if 
the sync logger message uses an infinity timeout, the {Ref, _} message 
is not a problem.  The CloudI logger has used this approach to handle 
large amounts of load ( 
https://github.com/CloudI/CloudI/blob/1128bba30404a3502a465ca636ba2ee02db544ce/src/lib/cloudi_core/src/cloudi_core_i_logger.erl#L1173 
).

Best Regards,
Michael


More information about the erlang-questions mailing list