Skip to content
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

aedes-stats reports 2 different topics on a k8s cluster #51

Open
massimo1980 opened this issue Nov 3, 2022 · 1 comment
Open

aedes-stats reports 2 different topics on a k8s cluster #51

massimo1980 opened this issue Nov 3, 2022 · 1 comment
Labels

Comments

@massimo1980
Copy link

Hi there,
my group has developed a MQTT server over a Kubernetes cluster. The actual service is reachable through a LoadBalancer that manage 2 pods of the same instance.
The service seems to work pretty well in performance's terms, but there are some strange numbers that we can't understand:

image

Using MQTT Explorer, we found 2 different sub-topics ID related to aedes-stats:
in the first one, seems to be reported the correct number of connected devices and "maximum" clients connected
the second one, instead, report a a slightly different number of connected clients, but the "maximum"clients seems to report something like "x2" of the first ID report
Is it possible that aedes-stats of the second sub-topic ( that presumably is the second pod of our cluster ) is reporting the "sum" of both "stats" ?

Tnx

@robertsLando
Copy link
Member

robertsLando commented Nov 3, 2022

Is it possible that aedes-stats of the second sub-topic ( that presumably is the second pod of our cluster ) is reporting the "sum" of both "stats" ?

Yes, with a quick look at source code you will see: https://github.com/moscajs/aedes-stats/blob/main/stats.js#L33

When two instances are up the first to run will get the correct number of clients and the second could miss some of them

PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants