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

Too many requests #325

Open
MagTun opened this issue Nov 22, 2019 · 7 comments
Open

Too many requests #325

MagTun opened this issue Nov 22, 2019 · 7 comments

Comments

@MagTun
Copy link

MagTun commented Nov 22, 2019

In short:
I am wondering what is your policy regarding Too Many Requests ?

  1. Is there a maximum Too Many Requests allowed per hour/day/week?
  2. Do you ban IP if you detect Too Many Requests? If yes, for how long?

The long story
I am using the BME680 sensor from Bosch with their library . This sensor/library only allows measurement every 3 seconds or every 5 min. 5 min is too long for my needs so I am left with the 3 seconds intervals.

Each time I retrieve a measurement, I send the data to my box on opensensemap but at this frequency, I get many (many) 429 Too Many Requests.

I don't mind if not all my measurement are saved on opensensemap. If I get 80% it's fine. But I do not want to get banned (even temporarily) from opensensemap if you detect too many Too Many Requests.

I am sending the data as JSON-Array on ingress.opensensemap.org/boxes/:senseBoxId/data (so I've already bundled all the values of a measurement like temperature, pression, humidity... in one request)

@MagTun MagTun changed the title Too many request Too many requests Nov 22, 2019
@ubergesundheit
Copy link
Member

Hi @MagTun

to start, the way you're sending (JSON-Array) is the right way!

The current limit is 15 requests in a 15 minutes window.

If you could change your code to collect measurements and send multiple measurement cycles at once. This would require you to collect the measurement timestamps on your device. Just include these timestamps with the field createdAt in your requests

@MagTun
Copy link
Author

MagTun commented Nov 22, 2019

The current limit is 15 requests in a 15 minutes window!? How is it possible that I was able to get this (the measurement were sent separately)?

image

@mpfeil
Copy link
Member

mpfeil commented Nov 22, 2019

Hi @MagTun

the current limit is 15 requests in one minute.

@MagTun
Copy link
Author

MagTun commented Nov 22, 2019

Ok that makes sense! So that's one every 4 seconds. I just found a way to delay my request so I am not anymore tied to the BME680 timing. Just to satisfy my curiosity : if I make a mistake and send a request every 1 or 2 seconds, do you ban the IP? if yes, for how long?

@ubergesundheit
Copy link
Member

Thanks for clarification @mpfeil :)
Maybe you could fill us in on how long the IP is being blocked?

@umut0
Copy link
Contributor

umut0 commented Dec 12, 2019

The IP will not be blocked. But all excessive requests will be blocked. Might change this in the future if people abuse this.

@markus2330
Copy link

We usually send one request per minute but nevertheless sometimes get 429 Too Many Requests. This happens after 502 Bad Gateway or ConnectionRefused, probably because our server tries to resend what it couldn't be send before.

This happens every few days or so. E.g. today 3:22 (Vienna) there was a connection refused and then plenty of 429 Too Many Requests.

Is it possible that there are server issues on your end sometimes refusing a few API requests? (The 429 Too Many Requests is probably only a side-effect, due to retries.)

Issue on our side is ElektraInitiative/opensesame#116

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants