Skip to content

Commit 2b776fa

Browse files
authored
Merge pull request rails#50664 from ghiculescu/global_executor_concurrency-example
Add an example to the `global_executor_concurrency` docs
2 parents 1db9705 + a40bb8e commit 2b776fa

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

guides/source/configuring.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,8 +1481,12 @@ queries can be executed concurrently.
14811481

14821482
Defaults to `4`.
14831483

1484-
This number must be considered in accordance with the database pool size configured in `database.yml`. The connection pool
1485-
should be large enough to accommodate both the foreground threads (.e.g web server or job worker threads) and background threads.
1484+
This number must be considered in accordance with the database connection pool size configured in `database.yml`. The connection pool
1485+
should be large enough to accommodate both the foreground threads (ie. web server or job worker threads) and background threads.
1486+
1487+
For each process, Rails will create one global query executor that uses this many threads to process async queries. Thus, the pool size
1488+
should be at least `thread_count + global_executor_concurrency + 1`. For example, if your web server has a maximum of 3 threads,
1489+
and `global_executor_concurrency` is set to 4, then your pool size should be at least 8.
14861490

14871491
#### `config.active_record.allow_deprecated_singular_associations_name`
14881492

0 commit comments

Comments
 (0)