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

Add memory limits #1237

Closed
kaizensparc opened this issue Apr 23, 2019 · 5 comments
Closed

Add memory limits #1237

kaizensparc opened this issue Apr 23, 2019 · 5 comments
Milestone

Comments

@kaizensparc
Copy link

Dear community,

I'm currently using mosquitto inside docker and I'm having issues with the cgroup memory limits making the mosquitto being OOM Killed when I send to many messages, or big binary messages.

I tried to find an option to limit its usage in order to refuse messages when there is no memory left, but the options I found are either:

  • max_queued_messages, which is not enough for this use case (There can be multiple mid-size messages and some very huge messages).
  • max_queued_bytes, but I need to control the number of devices that connect to the broker in order to set that parameter.

The ideal option in my case would have been some kind of general limit, not considering per-device/per-message limit.

I saw a message from Dec 2016 mentioning the same kind of option (https://www.eclipse.org/lists/mosquitto-dev/msg01400.html)

My proposal would be to add a total_memory_limit_bytes option, usable only when the memory tracking is enabled, that would refuse new messages from devices when full.

I am willing to implement this feature and give you a pull request, I was just wondering if there was another already-implemented option and if it would be ok for you?

Thanks

@ralight
Copy link
Contributor

ralight commented Apr 25, 2019

Did you see the memory_limit option?

@karlp
Copy link
Contributor

karlp commented Apr 25, 2019

is memory_limit in the docs (yet?) it's in the changelog, but not the man pages that I can see.

@kaizensparc
Copy link
Author

Wow that's a great news! Thank you for this, I didn't see that option! I'll try it asap!

@ralight
Copy link
Contributor

ralight commented Apr 26, 2019

@karlp Good point, I'll get it documented.

@ralight ralight added this to the 1.6.1 milestone Apr 26, 2019
@ralight
Copy link
Contributor

ralight commented Apr 26, 2019

I've documented this option now, so I'm closing this. If it doesn't do what you hoped then reopen and add more details.

@ralight ralight closed this as completed Apr 26, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants