How to detect too many messages? [Akka Actors]

1.3k Views Asked by At

Any actor can get too much messages. How to detect such bottleneck?

If it happen then how would look like the CPU usage? Would there be always at least 1 core on 100% usage or not?

In Akka 1.x I could check length of message queue but is it unavailable in 2.x. How to deal with it now?

1

There are 1 best solutions below

0
On BEST ANSWER

Too many messages in an actor do not cause any cpu issues - they would eventually consume a lot of memory depending on the messages and the used strategy. Have a look at these strategies: http://doc.akka.io/docs/akka/2.4.16/scala/mailboxes.html The default is an unbounded mailbox - so the system would eat up all the memory... (consider using backpressure for such cases - see akka streams)

Kamon allows you to see the actors metrics (mailbox size etc). This is quite simple to configure (but needs aspectj) http://kamon.io/integrations/akka/actor-router-and-dispatcher-metrics/