[Rt-commit] rt branch, 5.0/speed-up-tests-by-making-database-non-durable, updated. rt-5.0.0-3-g822a3860e1

Dianne Skoll dianne at bestpractical.com
Wed Aug 5 08:58:15 EDT 2020


The branch, 5.0/speed-up-tests-by-making-database-non-durable has been updated
       via  822a3860e1718cb8fd7b4b66d03b78c8e4c29bf9 (commit)
      from  00b7d2e57c4fae3641e90b50d4c383361e841252 (commit)

Summary of changes:
 docs/hacking.pod | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

- Log -----------------------------------------------------------------
commit 822a3860e1718cb8fd7b4b66d03b78c8e4c29bf9
Author: Dianne Skoll <dianne at bestpractical.com>
Date:   Wed Aug 5 08:56:27 2020 -0400

    Document (dangerous) DB optimizations to improve test speed.

diff --git a/docs/hacking.pod b/docs/hacking.pod
index 15742fb759..afed926041 100644
--- a/docs/hacking.pod
+++ b/docs/hacking.pod
@@ -214,6 +214,28 @@ running the tests in parallel.
 
     RT_TEST_PARALLEL=1 prove -l -j4 t/customfields/*.t
 
+=head2 Database Optimizations for Testing
+
+To improve the speed of testing, you may adjust the database configuration
+to optimize speed at the expense of losing durability (and potential database
+corruption.)
+
+For SQLite, the test suite automatically uses C<PRAGMA synchronous = 0> to
+eliminate many calls to C<fsync>, thereby greatly reducing disk I/O.
+
+For PostgreSQL, the test suite automatically uses C<SET
+synchronous_commit = OFF> to improve performance.  However, a much
+greater performance improvement can be realized by setting C<fsync =
+off> in the C<postgresql.conf> file.  (DO NOT set C<fsync = off> in a
+production system; doing so risks corrupting your entire PostgreSQL
+database.)
+
+For MySQL or MariaDB, the C<eatmydata> wrapper at L<https://www.flamingspork.com/projects/libeatmydata/>
+may be used to wrap the MySQL or MariaDB daemon; this uses C<LD_PRELOAD>
+to eliminate calls to C<fsync> and similar system calls.  (DO NOT user
+C<eatmydata> in a production system; doing so risks corrupting your entire
+MySQL database.)
+
 =head2 Tests with Docker
 
 RT has a Dockerfile that can be used to run the test suite for some configurations.

-----------------------------------------------------------------------


More information about the rt-commit mailing list