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
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With