benmmurphy.github.io - Ben's Blog

Description: This is an experiment where we try to find out how much faster Postgres will run if patch it to support non-durable reads. Postgresql supports a …

Example domain paragraphs

This is an experiment where we try to find out how much faster Postgres will run if patch it to support non-durable reads. Postgresql supports a number of options when commiting but the ones we are interested in at the moment are synchronous_commit = on and synchronous_commit = off . When it is set to on Postgresql will wait until the WAL is properly synchronized to the disk before returning to the client and when it is off it will not wait at all. Also, when it is on postgresql will not release any locks o

For example take this query:

1 UPDATE counters set counter = counter + 1 where id = 0; If you run this using pg_bench and 128 clients on Macbook Air with wal_sync_method = fsync and synchronous_commit = on you will get around 1283 transaction/s. This is with an fsync cost of about 0.2 ms. If you change wal_sync_method = fsync_writethrough this increases the fsync cost to about 10ms and the throughput will drop to around 90 transaction/s. If you switch synchronous_commit = off this will increase perforamnce and you will get around 2611