Solid Queue brought back the Async Mode in its recent release. The mode runs all Solid Queue entities (Supervisor, Worker, Dispatcher, Scheduler) in the same process, with the intention of reducing its memory usage. This makes its deployment in resource-constrained environments friendlier.


Setup

1) Update the solid queue gem to v1.3.0 or above.

2) We need to include a new flag (mode=aync) to enable this feature. In this example, we are using supervisor, and this can be done by updating the command.

[program:my-app-solid-queue]
...
directory=/path/to/app/current
command=/path/to/bundle exec ./bin/jobs start --mode=async
environment=RAILS_ENV=production
...

3) Then we can reread and update the supervisor. 


Validate

1) You can validate the current mode by checking the Solid Queue supervisor's name.

# async
user   1565540  solid-queue-async-supervisor(1.3.0): supervising 17576, 17584, 17592

# fork
user    431740 solid-queue-fork-supervisor(1.3.0): supervising 431785, 431789, 431793
user    431785 solid-queue-dispatcher(1.3.0): dispatching every 1 seconds
user    431789 solid-queue-worker(1.3.0): waiting for jobs in *
user    431793 solid-queue-scheduler(1.3.0): scheduling some_jobs