Domanda

I'm currently a startup and using non server grade NVMEs/SSD on my database server. My motherboard , CPU , DDR (ECC) etc are server grade except for the flash part.

I'm looking for ways to reduce the amount of writes on my Postgresql Database to preserve the lifespan of Flash Drives hopefully to reduce the failure rate.

My requirements

  • Write speed (Low Priority)
  • High Read speed & low latency (High Priority)
  • Low Writes (High Priority)

Questions

  • What kind of storage format do you recommend for a non-raided ubuntu system - ext4/xfs
  • What are the configuration settings I should look into
  • Any form of settings would improve usage of ram over flash drives
  • Should I reduce maintenance / vacuum frequency.
  • Block Size for Disk.
  • Separate disk for WAL ?
È stato utile?

Soluzione

To reduce the number of checkpoints as much as possible, increase max_wal_size and checkpoint_timeout. The price is longer recovery time after a crash.

Make sure that shared_buffers is not too low, so that there is no memory pressure that forces dirty pages out to disk between checkpoints. You could experiment with setting bgwriter_lru_maxpages = 0, so that the background worker does not proactively clean out pages between checkpoints.

Set wal_compression = on so that full page writes are compressed (at the expense of CPU time).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a dba.stackexchange
scroll top