GroveStreams

Once call every 10 seconds is allowed154

minollo private msg quote post Address this user
I currently have a "SmartThings app" pushing events to GroveStreans every 5 or 7 minutes; it performs a single PUT REST API call, batching a number of events received in that time interval.

But I still see the occasional warning in the system messages:
API Exception: Feed PUT call limit has been exceeded for address xx.yyy.185.42. One call every 10 seconds is allowed.

Considering that I'm fairly confident my REST API calls cannot exceed that limit, I'm wondering if the limit is actually imposed *per IP address*, and not *per IP address, per Account*. If that's the case (per IP address limit), of course we have a problem - which will become only worse if more SmartThings users start using your system: SmartThings is hosted in the AWS cloud infrastructure, and several "Smart apps" can run on the same physical AWS instance, of course; which will be seen by GroveStreams as the same IP (actually, that could even happen for multiple AWS instances, depending on how SmartThings configures things).

Can you please confirm if the limit of no more than one call every 10 seconds is just per IP or per IP+Account? If it's just per IP, is there any reason why it's not per IP+Account?

Thanks!
Post 1 IP   flag post
MikeMills private msg quote post Address this user
Today, we enforce the 10 second rule by outward facing IP address only. Account does not come into play.

There are some issues with this technique:
1) Sometimes there are multiple sensors behind a home or business router (which is the outward facing IP address) that need to upload every 10 seconds.
2) Random events can happen within the 10 second period and need to be pushed up as soon as they occur.
3) Some services like Electric Imp and SmartThings run in a cloud and share outward facing IP addresses (a bunch of cloud servers).
4) If a sensor uploads every 1 minute, and the http call takes around a minute (for whatever reasons - it happens). The next sensor upload could happen within 10 seconds and GS will reject it. This is actually a common scenario.

A workaround is to include X-Forwarded-For within the http header and assign it a unique value (see our Arduino example). GS will append that value to the outward facing IP address and use the appended value as the key for the 10 second check.

We're aware of these issues and are about to change the 10 second algorithm. We needed to change our internal locking strategy before we could make the change. The new locking strategy went into effect with yesterday's production site update. We're going to address the 10 second rule shortly. I'll try to remember updating this post aftwards. Otherwise monitory the Latest Changes Thread.
Post 2 IP   flag post
minollo private msg quote post Address this user
OK, thanks for confirming.
I modified my SmartThings app to include X-Forwarded-For, and that should address the problem on my side.
Post 3 IP   flag post
MikeMills private msg quote post Address this user
We've made a 10 second limit change. See: https://forum.grovestreams.com/topic/155/10-second-feed-put-limit-algorithm-change/
Post 4 IP   flag post
2968 4 4
Log in or sign up to compose a reply.