Re: PostgreSQL as a local in-memory cache - Mailing list pgsql-performance

From Pierre C
Subject Re: PostgreSQL as a local in-memory cache
Date
Msg-id op.vegjnqfreorkce@apollo13
Whole thread Raw
In response to Re: PostgreSQL as a local in-memory cache  (Josh Berkus)
List pgsql-performance
> Especially as, in repeated tests, PostgreSQL with persistence turned off
> is just as fast as the fastest nondurable NoSQL database.  And it has a
> LOT more features.

An option to completely disable WAL for such use cases would make it a lot
faster, especially in the case of heavy concurrent writes.

> Now, while fsync=off and tmpfs for WAL more-or-less eliminate the IO for
> durability, they don't eliminate the CPU time.

Actually the WAL overhead is some CPU and lots of locking.

> Which means that a caching version of PostgreSQL could be even faster.
> To do that, we'd need to:
>
> a) Eliminate WAL logging entirely
> b) Eliminate checkpointing
> c) Turn off the background writer
> d) Have PostgreSQL refuse to restart after a crash and instead call an
> exteral script (for reprovisioning)
>
> Of the three above, (a) is the most difficult codewise.

Actually, it's pretty easy, look in xlog.c


pgsql-performance by date:

Previous
From: Josh Berkus
Date:
Subject: Re: PostgreSQL as a local in-memory cache
Next
From: Dimitri Fontaine
Date:
Subject: Re: PostgreSQL as a local in-memory cache