snpr icon indicating copy to clipboard operation
snpr copied to clipboard

Add sidekiq-throttler to sidekiq jobs involving API

Open philippbayer opened this issue 9 years ago • 4 comments

As in this comment thread: https://github.com/openSNP/snpr/pull/251#discussion_r52427780

Use https://github.com/gevans/sidekiq-throttler for all API jobs to be nicer :sparkles: :sparkling_heart: :sparkles:

PLOS has 7200 requests per 24 hours, Mendeley has 500/hour maybe outdated source, Fitbit 150/hour source, SNPedia ???, but something much less

Edit: Looks like sidekiq-throttler only supports Sidekiq 2/3, not 4!

philippbayer avatar Feb 12 '16 15:02 philippbayer

This would address #96 as well I guess? :closed_book:

gedankenstuecke avatar Feb 12 '16 16:02 gedankenstuecke

Yes I'd hope so :D

However, sidekiq-throttler looks like it's not supported anymore. sidekiq-rate-limiter looks a bit wonky and unsupported, too. There's a sidekiq4 branch which looks like it works: https://github.com/Docady/sidekiq-rate-limiter/tree/sidekiq-4

philippbayer avatar Feb 12 '16 16:02 philippbayer

Sidekiq Enterprise has Rate Limiting. No clue how much this would cost... We can ask them, though.

tsujigiri avatar Feb 12 '16 16:02 tsujigiri

One problem is that sidekiq-limit_fetch, which we're currently using, is incompatible with the other rate-limiting gems, since they all patch into the way Sidekiq retrieves jobs from the queue.

One workaround is to remove sidekiq-limit_fetch and use the time-limits for non-API jobs like parsing, too. Yay/Nay?

philippbayer avatar Feb 13 '16 04:02 philippbayer