Rails Repetitive Background Job
I'm not sure what the best solution/practice is for Rails so I thought I'd ask here.
I need to have a background job or some kind of service that runs every 5 minutes to 开发者_高级运维calculate the rankings for a game for tens of thousands of users, and possibly very soon, hundreds of thousands of users. The resulting array would then be accessed for each request that needs to determine a ranking.
What are people using these days for this? A cron and rake task? The daemon gem? Resque or Beanstalkd?
Thanks for listening :)
Last time I used Clockwork gem with Delayed_job for the problem like you have
We had similar requirement for an application we developed. We used
whenever for scheduling cron jobs and delayed_job for background processing.
Whenever would trigger a cron every 5 minutes which would conditionally put an entry in the delayed job queue.
We could have also used Resque. Look at the comparison between delayed_job and resque to know what works best for you.
精彩评论