-
Notifications
You must be signed in to change notification settings - Fork 8
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
Rate Limit #6
Comments
Something like that would likely be possible, although the exact way to do that would require behavioral changes. Currently ruuvi-go-gateway "mimics" the physical gateway behavior, which is:
To add a rate limit, I suppose the MQTT implementation could either throttle by discarding or buffering measurements, and the HTTP version could perhaps be changed to skip a "tick" if no new measurements were received since the previous HTTP POST. Could you elaborate a little why you need a rate limit, so that I can come up with the best solution? |
Really it’s just about the frequency of readings being pumped into Influx DB. The default Ruuvitag frequency is much higher than I need. I could rate limit it downstream but I was wondering if it could be done at (almost) source in the gateway. I’m using MQTT, so discarding intermediate readings would work for me. |
Right, I guess adding an optional rate limit to MQTT specifically could be done with reasonable effort, and it would also be useful in situations where the MQTT server is either rate limited itself or a service that's billed by the amount of messages or something, so I think it would be an useful feature to have I need to think about the optimal way to do this along with a few other architectural changes I have planned, since right now the benefit of MQTT is that it's a "fire-and-forget" system that supports virtually unlimited amount of sensors without any memory or CPU overhead, but adding a rate limiter would increase the CPU and memory usage since it would need to keep track of each sensor separately to "remember" when they were last transmitted That combined with the fact that my free time is pretty limited at the moment means that it will take some time before I get to implement this |
Would it be possible to add a configuration to set a rate limit for tag readings?
Maybe something like "only send readings if they are x seconds older than the last reading" (for any sensor/metric).
The text was updated successfully, but these errors were encountered: