-
Notifications
You must be signed in to change notification settings - Fork 230
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
consume very slow when Inflights to many #340
Comments
@mochi-co , currently we store all QoS > 0 messages. Even if receive quota is exceeded: Lines 971 to 993 in 624dde0
With Expiry = -1, it also appears the message will never be removed from Inflight. This will also make cl.NextPacketID very slow and eventually fail. Perhaps we can make the following changes:
|
@mochi-co , PR #359 adds the ability to config maximum QoS > 0 message to store, which also means none of the clients send quota will exceed this value. With this PR, if message to be stored is > MaximumInflight, s.Info.InflightDropped is incremented, and logged, should we call OnQosDropped (but the message was never stored, so OnQosPublish was never called)? |
@VinsonWood , you can now config maximum inflight messages (Capabilities.MaximumInflight) per client in v2.4.6. Please let us know if it solves your issue. |
@thedevop |
@thedevop it works,thank you ! |
Hello, I am using Mochi to test offline messages. I have two clients subscribing to the same topic with a QoS of 1, and both have clean session turned off. This topic continuously receives QoS 1 data. When one of the clients disconnects, the Inflight for that client keeps accumulating, causing a continuous increase in memory usage. When the memory consumption reaches around 300-400 MB, the other connected client can only consume messages at an extremely slow rate, far below the sending rate of this topic. If the disconnected client reconnects, the Inflight and memory will be released, and memory consumption will reduce. At this point, the consumption rate will return to normal.
I know that I can use a hook to limit the size of the Inflight and, after the client disconnection, I can check the size of the client's Inflight to clear it. Are there any other elegant solutions available?
The text was updated successfully, but these errors were encountered: