Search code examples
erlangloggingfreezeerlang-otp

Erlang/OTP framework's error_logger hangs under fairly high load


My application is basically a content based router which will route MMS events.

The logger I am using is the one that comes with the OTP framework in SASL mode "error_logger"

The issue is ::

I am using a client to generate MMS events with default values. This client (in Java) has the ability to send high load of events in multiple THREADS

I am sending 100 events in 10 threads (each thread sending 10 MMS events) to the my router written in Erlang/OTP.

The problem is, when such high load is received by my router , my Logger hangs i.e it stops updating my Log file. But the router is still able to route the events.

The conclusions that I have come up with is ::

  1. Scheduling problem in Erlang when such high load of events is received (a separate process for each event).

  2. A very unlikely dead-loack state.

  3. Might be due to sending events in multiple threads rather than sending them sequentially. But I guess a router will be connected to multiple service provider boxes, so I thought of sending events in threads.

Can anybody help mw in demystifying the problem?


Solution

  • You already have a good answer, but I'll add to the discussion.

    The error_logger is by default using cached write operations to disk. So one possibility is that you don't really notice this while under low load, but under high load your writes get stuck in the cache for a while.

    On a side note: there should be no problem having multiple threads doing calls to Erlang.

    Another way of testing this is to add your own logger to error_logger, and see what happens. Possibly printing to the shell or something else that is "fast".