[erlang-questions] discarding signals

Jesper Louis Andersen jesper.louis.andersen@REDACTED
Wed Jun 15 17:34:16 CEST 2011

On Wed, Jun 15, 2011 at 04:02, József Bérces <jozsef.berces@REDACTED> wrote:

> If we are talking about an overloaded system that, for any reason, cannot tell the sender to reduce the traffic, then probably the only way to avoid a system crash is to discard the messages and notify the operators (raise an alarm, write event log, etc.) about this. So the discard shall be very quick as we are already overloaded. Do we have something for that?

I dare say that you want to concentrate on avoidance rather than
recovery. In other words, you want to write in some flow-control into
the application such that the problem never occurs in the first place.
The problem with recovering by emptying the queue is that it is as if
we lost those messages to the senders, so they won't react and
probably push us into another recovery phase soon thereafter. If we
have a flow-control system built in, the senders will know, mainly due
to timeouts, and can hence react to the situation. Effectively, you
are implementing queue bounds by the flow-control scheme so you can
limit how many messages are in the queue and keep the queue loaded at
a sustainable rate.

Another reason I'd prefer avoidance is that recovery is often way more
expensive in the long run. You will perhaps try to resend the messages
or redo a lot of heavy computation. Avoiding that in the first place
will also improve the throughput.


More information about the erlang-questions mailing list