Skip to content

Conversation

@mfn
Copy link
Contributor

@mfn mfn commented Aug 15, 2020

See https://www.postgresql.org/docs/current/runtime-config-wal.html#GUC-SYNCHRONOUS-COMMIT

Specifies whether transaction commit will wait for WAL records to be written to disk before the command returns a “success” indication to the client. Valid values are on, remote_apply, remote_write, local, and off

So, turning synchronous_commit off can be a useful alternative when performance is more important than exact certainty about the durability of a transaction.


My use-case is exact the last paragraph, so I can turn it off.

PR for showing the setting in the config => laravel/laravel#5375

See https://www.postgresql.org/docs/current/runtime-config-wal.html#GUC-SYNCHRONOUS-COMMIT
> Specifies whether transaction commit will wait for WAL records to be written to disk before the command returns a “success” indication to the client. Valid values are on, remote_apply, remote_write, local, and off
> …
> So, turning synchronous_commit off can be a useful alternative when performance is more important than exact certainty about the durability of a transaction.
@mfn mfn force-pushed the mfn-pgsql-sync-commit branch from 742f4a8 to 53aea3d Compare August 15, 2020 21:51
mfn added a commit to mfn/laravel that referenced this pull request Aug 15, 2020
It's deliberately not enabled but provided commented out so developers can easily
discover that the setting is available.

The default `on` is _probably_ safe (Postgres default), but a server might
have a different default value and blindly setting it to `on` may cause problems.

Connected to laravel/framework#33897
@taylorotwell taylorotwell merged commit b1f9fc5 into laravel:7.x Aug 17, 2020
@mfn mfn deleted the mfn-pgsql-sync-commit branch August 17, 2020 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants