Rails sidekiq in production

3

I am trying to build and produce an APP that uses Redis and Sidekiq for jobs in queues. In development it works as follows. Rodo the command in the terminal:

bundle exec sidekiq -q default

and let it roll. When I send the processes to the queue, through Rails the jobs are automatically executed. But on the production server I could not make it work in the same way. even because the connection is SSH. I do not know if there is anyone to configure the command to start consumption, inside Rails itself. Or if it's the same way as in development, opening a terminal with SSH connection and letting it go there. But then I fall into another doubt. What if the server restarts? Both Redis server and sidekiq are running manually. My Web Server is Apache2 and Passenger. Ruby version 2.2.3 and Rails 4.2.3

    
asked by anonymous 21.03.2016 / 14:20

1 answer

4

In production you should run Sidekiq in the background (via the -d parameter) and should also indicate the file where the sidekiq log will be written.

bundle exec sidekiq -d -L sidekiq.log -e production

Where you're going to run this depends a lot on how you're doing this deploy. If it's in Capistrano, there are hooks to run for you.

    
21.03.2016 / 14:34