We are in need of a queuing system in our Ruby On Rails 4 web application
what are the differences and why would/wouldn't you pick
Sidekiq over RabbitMQ?
It's quite different things with different usage. Sidekiq is full-featured solution for job queueing and processing, while RabbitMQ is just a message broker where you can build your own stuff upon it.
Related
A standard rails app will have web servers for the front end and workers servers for background jobs. Aws-rails-provisioner is a fantastic tool, but does it support the generation of the background workers stack? I could not find out how to define it using the aws-rails-provisioner.yml file.
So, I renamed several dangerous Redis commands in redis.conf, after that Sidekiq WEB UI stopped showing any statistics yet Sidekiq is functioning fine. My question is which Redis commands does Sidekiq use? Which should I specify are renamed when configuring server and client inside Sidekiq initializer?
There is no canonical list but the current Sidekiq supports Redis 2.8 so none of the newer commands in 3.0+.
I am able to get Sidekiq scheduler working locally. The last obstacle in my way is how to deploy this to a production app on passenger. Can someone point me in the right direction on how to run Sidekiq continuously on passenger.
Appreciate it.
Passenger is a Apache\nginx module for running Rails\Rack apps.
Sidekiq is a threaded background worker queue that usually is run with JRuby in production.
You do not run Sidekiq through Passenger.
Rather, just configure Passenger to run and serve you app as needed. Then you can start Sidekiq and have it poll Redis for work. It is highly recommend you use either JRuby or Rubinius so you take full advantage of Sidekiq's threaded nature.
For more details on deploying Sidekiq, refer to the wiki:
https://github.com/mperham/sidekiq/wiki/Deployment
For more details on configuring Passenger refer to it's docs (for either Apache or nginx):
https://www.phusionpassenger.com/support#documentation
Update: From the creator of Sidekiq there is a library called Girl Friday. This library adds an asynchronous job queue but runs inline with your Rails application (or other Rack app). This option can greatly simplify deployment and save money!
I have a Reporter worker for Resque in my Rails 3.2.8 application. I frequently add new reports for users, or fix bugs in existing reports.
Reports are deployed as Ruby modules whose methods are called by the Resque reporter worker.
Every time I deploy new code, I have to restart Resque. During that time, there are often one or more reports out there that are then killed, left with a status of "Running". What I want to find out is, is there a way to get Resque to reload the ruby modules that it uses to run the reports?
Instead of reloading you could stop the resque workers with a kill -s QUIT. That will cause the workers to finish running their reports before shutting down.
More info on using signals with resque is here, https://github.com/defunkt/resque#signals.
I'm currently porting a Rails App currently using REE to JRuby so I can offer an easy-to-install JRuby alternative.
I've bundled the app into a WAR file using Bundler which I'm currently deploying to GlassFish. However, this app has a couple of daemon processes and it would be ideal if these could be part of the WAR file, and potentially monitored by Glassfish (if possible).
I've looked at QuartzScheduler, and while meets my needs for a couple of things, I have a daemon process that must execute every 20 seconds as it's polling the database for any delayed mail to send.
If anyone can provide any insight as to how best to set up daemon processes in a JRuby/Java/Glassfish environment any help will be greatly appreciated! :)
One way to daemonize a JRuby process is to use akuma framework (on *nix) or others.
I would rather use cronjobs (schedulling) rather than daemons as they are less error-proned, daemons can leak memory, can stop on errors etc. Check jruby-quartz and quartz_scheduler
EDIT
If one uses Torquebox it offers support for services and scheduling.