Tuesday, July 03, 2018

Running Jobs in the Background

1. Active Job Async

Configure queue_adapter in config/application.rb:

config.active_job.queue_adapter = ActiveJob::QueueAdapters::AsyncAdapter.new 
  min_threads: 1,
  max_threads: 2 * Concurrent.processor_count,
  idletime: 600.seconds

2. Use perform_later when you send the email.

3. Linode $5 box has one core:

$ grep -c ^processor /proc/cpuinfo   

1

References