-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Negative number of disconnected clients on 2.0.14 #2466
Comments
I'm seeing the same thing on version 2.0.13. Also, the number of active and connected clients is much higher than should be possible with the number of devices that I have connected. |
What is happening here, is that there are two tables internal to mosquitto used to generate those numbers. The first contains all of the client ids of clients that are on the broker. The second contains all of the network sockets of clients that are connected to the broker. The list of client ids includes all clients - which means those currently connected and those that have persistent sessions that are not currently connected. The list of network sockets includes all clients that currently have a network connection open with the broker, regardless of whether they have sent a CONNECT packet, for example. @peteman720 - if you have clients that are connecting slowly, or not sending their CONNECT for some reason, or have a long keepalive and have subsequently lost their network connection without the broker noticing, then you will end up with a greater number of It is also this same sort of case that leads to negative numbers of disconnected clients. That is calculated using a simple "count of client ids" - "count of sockets", which is clearly not going to work in the case I've described above. I'm not sure what the best solution is, it would be nice to fix but I don't want to add a chunk of complexity to do so. |
Uh..... Well, thank's, at least I had know the reason. |
Hi,
I have an issue where I'm seeing negative numbers of inactive/disconnected clients. Any ideas about how that can happen?
And on Grafana:
The text was updated successfully, but these errors were encountered: