Setting up Sidekiq and Redis on VPS

Sidekiq is useful for background Rails workers. Instead of tying up your rails server, it’s better to handle certain processes asynchronously.

Setting up Sidekiq on your VPS is simple.

Install Redis

With a Linode guide, install Redis. Make sure to use the latest Redis version (2.6.9 for me) instead of 2.2.2 as the guide discusses. Run [cci]sudo make test[/cci] to test your Redis setup. If all goes well, you should see [cci]\o/ All tests passed without errors![/cci]. The Linode guide will also go over the Deploy Init Script so that your Redis starts up when you reboot your VPS.

Config Capistrano File

With Capistrano, you need to edit your [cci]config/deploy.rb[/cci] to include the line [cci]require ‘sidekiq/capistrano'[/cci]. [cci]For config/sidekiq.yml[/cci] options, see the Sidekiq wiki.

That’s it. Make sure to have your server rebooted so that Redis is running on the default port, and Sidekiq can access Redis upon your [cci]cap deploy[/cci].