then, to check the connected AMI, I hit the command:
manager show connected
but none of the manager connections show. Then how will the subscription not be cleaned up? if there are no connections, it should be cleaned right. A little knowledge will be helpful
Connections don’t individually subscribe. Manager subscribes as a whole when it loads and it is enabled. Even with no connections there will still be subscriptions and the topic will still exist.
Building with DEVMODE enabled would add statistics CLI commands, which show more information. In this case “stasis statistics show topic manager:core” would include a list of subscriptions.
As in reality, I can’t do that because the asterisk is in production, but something weird I observed is that there are two managers during the core show task processors in the site
Like I saw stasis/p:manager-core - 30 with a different last number and stasis/m:manager-core in only one, but in my test environment, I just witnessed only
stasis/m:manager:core-00000006
What’s the difference between these two i just confused. I get a larger number of stasis/p:manager:core- but stasis/m:manager:core- only one
Sorry for the inconvenience I caused. This slows down the call process in this warning.
They are subscriptions from something. A prefix “m” means mailbox, that is it has a dedicated thread for handling messages. A prefix of “p” means pooled, which means it uses the stasis threadpool for handling messages.
I mean, I want to know when the mailbox that is a dedicated thread is used for handling messages, and when the thread pool is used for handling messages
It’s not random. It’s up to the developer who implemented the code that does the subscription. Each has pros/cons, and depending on the usage one can be a better fit than the other.
Okay, after analyzing the Asterisk repo code, I found out the manager.c subscribing to the mailbox dedicated thread during manager subscription init instead of the thread pool, but in production, manager: core is subscribing to the thread pool, where I am seeing prefix “p” there, as shown in the above. so somehow the manager.c core subscribing to both the thread pool and the mailbox. which stasis/pool-control overloaded
There can be multiple subscriptions, which you’ve shown. There IS a a mailbox based subscription which was likely the manager.c subscription itself. There are also OTHER subscriptions from somewhere else using pool. This does not mean that manager.c itself is subscribing using the pool, other things can. I don’t know what those things are.
I saw many manager:core in pooled-based subscriptions in core show taskprocessors. So manager:core can be subscribed to by others using the pool-based subscriptions instead of manager.c?
I do actually have a PR up[1] which improves the performance of stasis, and eliminates “stasis/pool-control” which would lessen the impact, though wouldn’t solve the fact the subscriptions exist in the first place. It’ll be released in ~1.5-2 months.