diff options
author | Matthew Draper <matthew@trebex.net> | 2018-08-23 01:04:14 +0930 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-23 01:04:14 +0930 |
commit | 24f6bf0d96b58f2b2ef6a886c93d35cf8ce4f293 (patch) | |
tree | 6bbe27eb6d6e12ec25c2574cfd13b8397bafb638 /guides/source/configuring.md | |
parent | 047a893da7a43b8e115b854c73735b9e6475838e (diff) | |
parent | 20bb397e00dad9dfdb38d0c8dd73062b448c31e3 (diff) | |
download | rails-24f6bf0d96b58f2b2ef6a886c93d35cf8ce4f293.tar.gz rails-24f6bf0d96b58f2b2ef6a886c93d35cf8ce4f293.tar.bz2 rails-24f6bf0d96b58f2b2ef6a886c93d35cf8ce4f293.zip |
Merge pull request #33691 from tgxworld/add_config_to_disable_advisory_locks
Add database configuration to disable advisory locks.
Diffstat (limited to 'guides/source/configuring.md')
-rw-r--r-- | guides/source/configuring.md | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/guides/source/configuring.md b/guides/source/configuring.md index 6e4f1f9648..36882fec3f 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -989,6 +989,14 @@ development: If your development database has a root user with an empty password, this configuration should work for you. Otherwise, change the username and password in the `development` section as appropriate. +Advisory Locks are enabled by default on MySQL and are used to make database migrations concurrent safe. You can disable advisory locks by setting `advisory_locks` to `false`: + +```yaml +production: + adapter: mysql2 + advisory_locks: false +``` + #### Configuring a PostgreSQL Database If you choose to use PostgreSQL, your `config/database.yml` will be customized to use PostgreSQL databases: @@ -1001,12 +1009,13 @@ development: pool: 5 ``` -Prepared Statements are enabled by default on PostgreSQL. You can disable prepared statements by setting `prepared_statements` to `false`: +By default Active Record uses database features like prepared statements and advisory locks. You might need to disable those features if you're using an external connection pooler like PgBouncer: ```yaml production: adapter: postgresql prepared_statements: false + advisory_locks: false ``` If enabled, Active Record will create up to `1000` prepared statements per database connection by default. To modify this behavior you can set `statement_limit` to a different value: |