]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Optimize mysql and postgresql for write IO
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Fri, 20 Dec 2019 00:51:17 +0000 (01:51 +0100)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Fri, 20 Dec 2019 03:12:30 +0000 (04:12 +0100)
modules/private/databases/mariadb.nix
modules/private/databases/postgresql.nix

index 632306cf23193c3caf96aec68a5cdaae637afc7c..3359064b9d3f6141be744f183c02225177c3dbe0 100644 (file)
@@ -102,6 +102,10 @@ in {
         # for replication
         log-bin=mariadb-bin
         server-id=1
+
+        # this introduces a small delay before storing on disk, but
+        # makes it order of magnitudes quicker
+        innodb_flush_log_at_trx_commit = 0
         '';
     };
 
index 1932a824ac9f73072f700e9cd98256ea9e43d4e0..3dcd311798f7232166537cffc1c707f92dddfc50 100644 (file)
@@ -161,6 +161,9 @@ in {
         lc_numeric = 'en_US.UTF-8'
         lc_time = 'en_US.UTF-8'
         default_text_search_config = 'pg_catalog.english'
+        # this introduces a small delay before storing on disk, but
+        # makes it order of magnitudes quicker
+        synchronous_commit = off
         ssl = on
         ssl_cert_file = '${config.security.acme.directory}/postgresql/fullchain.pem'
         ssl_key_file = '${config.security.acme.directory}/postgresql/key.pem'