简体   繁体   中英

How to detect too many messages? [Akka Actors]

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?

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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM