Merge pull request #50664 from ghiculescu/global_executor_concurrency-example

Add an example to the `global_executor_concurrency` docs
This commit is contained in:
Jean Boussier 2024-01-10 08:51:16 +01:00 committed by GitHub
commit 2b776fad28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

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