I'm trying to setup a postgres server using Ceph as storage. After taking benchmarks, it was obvious that even though the storage has a really good throughput, the higher latency brought by network and Ceph (~15ms vs <0.1ms for a normal SSD storage) creates a huge bottleneck.

A setting of fsync = off improves performance tremendously, but of course, is not a viable solution since it may create data corruptions in case of power outage, etc. There is also wal_sync_method, but even though changing it improves TPM a bit, its effect are negligible.

How can I configure the Postgres or change the design of my system (e.g. using different storage for WAL and data) to improve performance?

  • 1
    Welcome to the site, what is the O.S environment with their version(x,y,z)? – Md Haidar Ali Khan May 1 '19 at 8:41
  • I have no experience with Ceph but I have read that it’s possible to use a local cache with it. – Colin 't Hart May 1 '19 at 13:17
  • Are the benchmarks you ran relevant to your expected use case? I think that more people are limited by read than by single-threaded fsync. – jjanes May 1 '19 at 14:31
  • Why are you using Ceph? You might be able to get around the slow fsync by putting WAL on local disk, but that might defeat the whole purpose of using Ceph in the first place. Depending on what that purpose is. – jjanes May 1 '19 at 14:33
  • @MdHaidarAliKhan The Postgres itself is ran on a Kubernetes cluster. – Mohammadreza MontazeriShatoori May 5 '19 at 7:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.