-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Measuring mailbox size #383
Comments
As an example this is how I am going about this at the moment, if we could expose the required properties publicly that would be a start, unless there is a more elegant way to do this.
|
I don't mind making
|
cc @akkadotnet/developers this plays into a larger issue that I'd like to bring up, which is adding some monitoring hooks to measure the internals of Akka.NET in production. Stuff like mailbox queue length, supervisor restarts / shutdowns, transport errors, etc... You can capture a lot of this in userspace via manual logging calls inside actors and the logging system (which is how Akka.Monitoring currently does it) but some of this data you can't really access and it's onerous to capture everything manually inside each actor. The way this gets handled in canonical Akka is often via AspectJ and bytecode injection - .NET doesn't really have anything that can do that (PostSharp can kind of do this.) Is there any interest in designing some of our internals to support optional monitoring hooks? The default behavior would be NoOp - no monitoring, so there shouldn't be any overhead, but I'd love to be able to instrument some of these metrics in production. |
Yes, we should add some infrastructure for monitoring imo. How is your monitoring designed right now? |
@rogeralsing some of it uses the event stream (unhandled messages and debug statistics) and others require a manual call inside Actor.OnReceive, PreStart, or PostStop inside each actor implementation. So here's what I would do for a standard monitoring API: Actors (by type)
Mailboxes
Remoting
A bunch of this stuff is available inside internal classes inside the EventBus, so a third party component can't really subscribe to it without an API exposing it. What I'd propose doing is create a standard The |
I'm all for this, and the lifecycle events should be hooked directly into the actorcell call sites, right? At what point should mailbox size be measured? for each posted message? |
Hi, has there been any progress on this? It is a very important area I think for monitoring where messages are backing up, whats slowing down the system. |
Some news? |
+1 |
1 similar comment
+1 |
So we support this inside Phobos, Petabridge's Enterprise DevOps Suite for Akka.NET: https://phobos.petabridge.com/articles/monitoring/configuration.html If you set enable the I should note here that Phobos is a commercial product and requires a license. |
If you want to access this data yourself in Akka.NET today, there's a way to do it but it requires getting access to some of the "internal," yet publicly exposed APIs: // from within an actor
Context.AsInstanceOf<ActorCell>().Mailbox..MessageQueue.Count); I think that should allow you to get access to the number, but note that on really high throughput actors this will may have a performance impact as I believe accessing the |
Thanks I will try that, we don't manage millions of events per second but we do load the machine heavily with other processes that can consume a lot of CPU... |
After a discussion with Aaron this morning over here: https://github.com/Aaronontheweb/akka-monitoring/issues/2
I thought it would be a good idea to bring this here, does anyone have any ideas on how this can best be implemented in the core? happy to help with implementation if required.
Cheers
Stefan
The text was updated successfully, but these errors were encountered: