質問

I have an app for Android which checks for new notifications from Facebook every N minutes, where N is more than 5 minutes (default is 30 minutes). That app also makes some user-generated requests to Facebook's Graph API. Recently (since the moment we added scheduled polling for new notifications), Facebook started to limit our app (with error #17 "User request limit reached" mostly, but sometimes it gives error #4 "Application request limit reached"). The Insights Dashboard gives us following statistics: 255,000 requests per day, 432 users. That gives roughly 590 requests per user per day, which is far from any mentioned limit for API I was able to find. Facebook's information on rate limiting is really vague, here are some numbers you can usually find in different sources:

  1. 600 calls per 600 seconds per token per IP.
  2. 100M calls per day per app.
  3. 10,000 calls per user token per day.

The scheduled requests which our app does on a regular basis is a simple FQL:

SELECT sender_id,created_time,title_text FROM notification WHERE recipient_id=me() AND is_hidden = 0 AND is_unread = 1

Even with the minimal update interval of 5 minutes, it will be fired 288 times per day. We tried to replace this request with Graph API call, but it didn't change a thing.

I know that there are other apps that have similar functionality and they seem to not have these limitations.

Does anybody know if there are any way to avoid being limited by Facebook with such reasonably low amount of calls?

Thanks!

役に立ちましたか?

解決

It turned out that there was a nasty bug in the code which was really hard to reproduce, that sometimes forced the app to make API requests in a loop for 10-30 minutes in a row. Only a small percent of clients had that problem, but it was enough to bump into API limits.

It seems that FB API calculates limits based on the number of users of the app, so even with a rather limited amount of calls we had a rate limiting problem. Another observation is that despite the fact that only a limited number of users were doing a lot of API calls, FB did limiting for all users.

Hope that information will be helpful somehow to resolve similar issues.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top