testcontainers-node icon indicating copy to clipboard operation
testcontainers-node copied to clipboard

Use memfs for PostgreSQL

Open moltar opened this issue 1 year ago • 4 comments

By setting this:

PG_DATA: /dev/shm/pgdata/data

We could use memfs, and then speed up the container.

Other options and ideas for the test speed-ups:

  • https://marcopeg.com/how-to-run-postgres-for-testing-in-docker/
  • https://gajus.com/blog/setting-up-postgre-sql-for-running-integration-tests

I've been running tests for years with these options, without any known side effects:

-c shared_buffers=128MB -c fsync=off -c synchronous_commit=off -c full_page_writes=off

moltar avatar Apr 20 '24 10:04 moltar

Hi @moltar. Interesting, thanks for the info.

Feel free to raise a PR and if tests pass I don't see any issue in merging.

cristianrgreco avatar Apr 28 '24 07:04 cristianrgreco

Should this be a withX helper method you think?

moltar avatar Apr 29 '24 16:04 moltar