You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-24Lines changed: 2 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,7 +80,7 @@ We have three types of actors in Solid Queue:
80
80
-_Dispatchers_ are in charge of selecting jobs scheduled to run in the future that are due and _dispatching_ them, which is simply moving them from the `solid_queue_scheduled_executions` table over to the `solid_queue_ready_executions` table so that workers can pick them up. They're also in charge of managing [recurring tasks](#recurring-tasks), dispatching jobs to process them according to their schedule. On top of that, they do some maintenance work related to [concurrency controls](#concurrency-controls).
81
81
- The _supervisor_ runs workers and dispatchers according to the configuration, controls their heartbeats, and stops and starts them when needed.
82
82
83
-
By default, Solid Queue runs in `fork` mode. This means the supervisor will fork a separate process for each supervised worker/dispatcher. There's also an `async` mode where each worker and dispatcher will be run as a thread of the supervisor process. This can be used with [the provided Puma plugin](#puma-plugin)
83
+
Solid Queue's supervisor will fork a separate process for each supervised worker/dispatcher.
84
84
85
85
By default, Solid Queue will try to find your configuration under `config/solid_queue.yml`, but you can set a different path using the environment variable `SOLID_QUEUE_CONFIG`. This is what this configuration looks like:
86
86
@@ -131,7 +131,7 @@ Here's an overview of the different options:
131
131
132
132
Finally, you can combine prefixes with exact names, like `[ staging*, background ]`, and the behaviour with respect to order will be the same as with only exact names.
133
133
- `threads`: this is the max size of the thread pool that each worker will have to run jobs. Each worker will fetch this number of jobs from their queue(s), at most and will post them to the thread pool to be run. By default, this is `3`. Only workers have this setting.
134
-
- `processes`: this is the number of worker processes that will be forked by the supervisor with the settings given. By default, this is `1`, just a single process. This setting is useful if you want to dedicate more than one CPU core to a queue or queues with the same configuration. Only workers have this setting. **Note**: this option will be ignored if [running in `async` mode](#running-as-a-fork-or-asynchronously).
134
+
- `processes`: this is the number of worker processes that will be forked by the supervisor with the settings given. By default, this is `1`, just a single process. This setting is useful if you want to dedicate more than one CPU core to a queue or queues with the same configuration. Only workers have this setting.
135
135
- `concurrency_maintenance`: whether the dispatcher will perform the concurrency maintenance work. This is `true` by default, and it's useful if you don't use any [concurrency controls](#concurrency-controls) and want to disable it or if you run multiple dispatchers and want some of them to just dispatch jobs without doing anything else.
136
136
- `recurring_tasks`: a list of recurring tasks the dispatcher will manage. Read more details about this one in the [Recurring tasks](#recurring-tasks) section.
137
137
@@ -159,16 +159,6 @@ When receiving a `QUIT` signal, if workers still have jobs in-flight, these will
159
159
If processes have no chance of cleaning up before exiting (e.g. if someone pulls a cable somewhere), in-flight jobs might remain claimed by the processes executing them. Processes send heartbeats, and the supervisor checks and prunes processes with expired heartbeats, which will release any claimed jobs back to their queues. You can configure both the frequency of heartbeats and the threshold to consider a process dead. See the section below for this.
160
160
161
161
162
-
### Fork vs. async mode
163
-
164
-
By default, the supervisor will fork additional processes for each worker and dispatcher so that they run in different processes. This provides the best isolation and performance, but can have additional memory usage. Alternatively, you can run all workers and dispatchers in the same process as the supervisor by passing `--mode async` when starting it:
165
-
```
166
-
bin/jobs --mode async
167
-
```
168
-
169
-
If you use the `async` mode, the `processes` option in the configuration will be ignored.
170
-
171
-
172
162
### Dedicated database configuration
173
163
174
164
Solid Queue can be configured to run on a different database than the main application.
@@ -315,18 +305,6 @@ plugin :solid_queue
315
305
```
316
306
to your `puma.rb` configuration.
317
307
318
-
### Running as a fork or asynchronously
319
-
320
-
By default, the Puma plugin will fork additional processes for each worker and dispatcher so that they run in different processes. This provides the best isolation and performance, but can have additional memory usage.
321
-
322
-
Alternatively, workers and dispatchers can be run within the same Puma process(s). To do so just configure the plugin as:
323
-
324
-
```ruby
325
-
plugin :solid_queue
326
-
solid_queue_mode :async
327
-
```
328
-
329
-
Note that in this case, the `processes` configuration option will be ignored.
330
308
331
309
## Jobs and transactional integrity
332
310
:warning: Having your jobs in the same ACID-compliant database as your application data enables a powerful yet sharp tool: taking advantage of transactional integrity to ensure some action in your app is not committed unless your job is also committed. This can be very powerful and useful, but it can also backfire if you base some of your logic on this behaviour, and in the future, you move to another active job backend, or if you simply move Solid Queue to its own database, and suddenly the behaviour changes under you.
Copy file name to clipboardExpand all lines: UPGRADING.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,10 @@
1
+
# Upgrading to version 0.7.x
2
+
3
+
This version removed the new async mode introduced in version 0.4.0 and introduced a new binstub that can be used to start Solid Queue's supervisor. To install it, you can just run
4
+
```
5
+
bin/rails generate solid_queue:install
6
+
```
7
+
1
8
# Upgrading to version 0.6.x
2
9
3
10
## New migration in 3 steps
@@ -44,7 +51,7 @@ And then run the migrations.
44
51
45
52
46
53
# Upgrading to version 0.4.x
47
-
This version introduced an _async_ mode to run the supervisor and have all workers and dispatchers run as part of the same process as the supervisor, instead of separate, forked, processes. Together with this, we introduced some changes in how the supervisor is started. Prior this change, you could choose whether you wanted to run workers, dispatchers or both, by starting Solid Queue as `solid_queue:work` or `solid_queue:dispatch`. From version 0.4.0, the only option available is:
54
+
This version introduced an _async_ mode (this mode has been removed in version 0.7.0) to run the supervisor and have all workers and dispatchers run as part of the same process as the supervisor, instead of separate, forked, processes. Together with this, we introduced some changes in how the supervisor is started. Prior this change, you could choose whether you wanted to run workers, dispatchers or both, by starting Solid Queue as `solid_queue:work` or `solid_queue:dispatch`. From version 0.4.0, the only option available is:
Copy file name to clipboardExpand all lines: lib/solid_queue/cli.rb
+1-2Lines changed: 1 addition & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,6 @@
5
5
moduleSolidQueue
6
6
classCli < Thor
7
7
class_option:config_file,type: :string,aliases: "-c",default: Configuration::DEFAULT_CONFIG_FILE_PATH,desc: "Path to config file"
8
-
class_option:mode,type: :string,default: "fork",enum: %w[forkasync],desc: "Whether to fork processes for workers and dispatchers (fork) or to run these in the same process as the supervisor (async)"
0 commit comments