vitosamson / modlogs

A service for allowing subreddits to publish their moderator logs
https://modlogs.fyi
14 stars 3 forks source link

Strategy for dealing with the reddit API rate limit #14

Open vitosamson opened 6 years ago

vitosamson commented 6 years ago

As more subs start using modlogs, it's getting harder to stay under the reddit rate limit. This is especially prevalent during the initial import of a sub's logs, I think, because of the massive amount of requests needed to fetch thousands of logs.

Some quick thoughts:

justcool393 commented 4 years ago

One thing that may be useful that each request for the /about/log can take up to 500 (with ?limit=500) instead of the usual 100. This gets a whole lot more for each request.

xaur commented 3 years ago

?limit=500 is great for initial sync. Mind that Reddit also has some limit how far back you can go (not sure if it is based on time or the number of items).

For incremental syncs I would use a smaller limit but it may depend on how active the sub is.

Tracked subs with low activity can be checked less frequently. For example, you can compute a simple average activity based on past N days and estimate how often to poll it again and/or the limit param.