3 ms·
Point Postgres data directory to a memory-backed tmpfs, makes the thing blazing fast.
by loloquwowndueo 3y ago
Point Postgres data directory to a memory-backed tmpfs, makes the thing blazing fast.
- paulryanrogers 3y agoI've done this for MySQL too. Saved our CI times on GitHub Actions after upgrading to MySQL 8 and the single threaded performance dropped.
- sa46 3y agoI've tried--macOS doesn't make it easy. It's not a clear performance win since tmpfs with Postgres fsync=off is mostly memory-backed storage via the page cache already. Another problem is that parallel tests can exhaust memory. The slowest part of our tests is syscall overhead. A mostly empty Postgres data dir for a medium-sized database with a few hundred tables consists of 3k files. On my M1 macOS, it takes 120 ms to delete the entire data dir. Copying is cheaper at 80 ms using clonefile.