Pages

Friday 3 February 2012

Redis Memory Issue with Resque

Resque maintains its information/traces/jobs in Redis, a very pupular and fast in-memory key value storage.

After shifting to heroku the redis memory starts getting increase day by day and the temporary solution was to keep adding more powerful redis add-ons which was a poor approach and expensive one.

So decided to flush the old memory as there is no need to keep the old processed jobs data by resque. Thanks to Heroku's support time that they put the right direction for flush all of memory.


 uri = URI.parse(ENV["REDISTOGO_URL"])
 redis = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)
 redis.flushall

It will clear all your redis contents and if you look to resuque web console all counters and queues jobs has been reset and going to start from their seed values.

:)




No comments:

Post a Comment