Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start Sidekiq worker on Ubuntu VPS (Digitalocean)

I already setup Redis, Sidekiq and Rails app, I can access it form //url/sidekiq, but how do I start the Sidekiq worker on a VPS? On my local I do:
bundle exec sidekiq -q carrierwave,5 default

What should I do on a VPS hosting?

Thanks

like image 441
user1883793 Avatar asked May 01 '13 10:05

user1883793


People also ask

How do you run a Sidekiq worker?

To run sidekiq, you will need to open a terminal, navigate to your application's directory, and start the sidekiq process, exactly as you would start a web server for the application itself. When the command executes you will see a message that sidekiq has started.

What is Sidekiq worker?

A Sidekiq job is a program (a Ruby class) that carries out a subset of a task, and larger tasks are normally broken down into many smaller jobs that can then be processed in parallel by a fleet of workers.


1 Answers

Looks like this is a duplicate of this question: how to detach sidekiq process once started in terminal

You have to run the following command from your Rails root:

bundle exec sidekiq -d -L sidekiq.log -q mailers,5 -q default -e production

This will detach the process so you can quit the ssh session and the command will keep running in the background, logging the output to the sidekiq.log file.

Take care to choose the appropriate position for the log file, and don't forget to setup a logrotate rule for it.

like image 197
Fabrizio Regini Avatar answered Oct 05 '22 15:10

Fabrizio Regini