[erlang-questions] discarding signals

Max Lapshin max.lapshin@REDACTED
Wed Jun 15 06:59:51 CEST 2011


On Wed, Jun 15, 2011 at 6:02 AM, József Bérces
<jozsef.berces@REDACTED> wrote:
> Thanks.
>
> Actually, the real question is the performance of going through the inbox and discarding 1 by 1.
>
> 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?
>

flush() ->
  receive
    Message -> flush()
  after
    0 -> ok
  end.

Is really fast. If you _think_ that it is not fast, than you are on
wrong way, because you are going to build high loaded system, based on
thinks.

You must have benchmarks, that appears to look like real load. And if
you will find on these benchmarks that it is not enough, than you will
need to
do something more.



More information about the erlang-questions mailing list