[erlang-questions] New OTP app available at GitHub: riak_err

Scott Lystig Fritchie <>
Fri Nov 12 02:27:33 CET 2010


Max Lapshin <> wrote:

ml> Don't forget to add 5000000 of messages into message queue when
ml> making these tests =)

Yes, there is that little problem ... but that isn't a problem that
riak_err is trying to solve(*).  As has been pointed out by Ulf Wiger
and many others, if there isn't a way to apply backpressure on the
client (i.e. error/whatever event generators) to get them to slow down,
then the server (i.e. a gen_event server like error_logger) doesn't have
many options for defense.

However, on an N-CPU-core system, it's even less likely that one of
those options will work: throw away work.  Even if the event handler
could keep state about how many events/sec it could handle and then
throw events that exceed that limit, there's only 1 CPU core (maximum)
that can run the gen_event server.  There are N-1 cores still available
to run obnoxious clients to overflow the server's mailbox anyway.

I'm not above putting a less-vulnerable-to-mailbox-overruns
gen_event.beam file into another directory, un-sticky the kernel's code
directory, and load the patched gen_event.beam into a running system
... but then again, I'm also known(**) for dirtier-than-my-colleagues'-
tastes-permit hacks.

-Scott

(*) At least, not yet.

(**) If those individuals don't have better solutions, they are welcome
to remain silent.  :-)


More information about the erlang-questions mailing list