From 0907cf1ba08ad04cff9b1fe805ac6f2072c24142 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Fri, 20 Dec 2019 01:51:17 +0100 Subject: [PATCH] Optimize mysql and postgresql for write IO --- modules/private/databases/mariadb.nix | 4 ++++ modules/private/databases/postgresql.nix | 3 +++ 2 files changed, 7 insertions(+) diff --git a/modules/private/databases/mariadb.nix b/modules/private/databases/mariadb.nix index 632306c..3359064 100644 --- a/modules/private/databases/mariadb.nix +++ b/modules/private/databases/mariadb.nix @@ -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 ''; }; diff --git a/modules/private/databases/postgresql.nix b/modules/private/databases/postgresql.nix index 1932a82..3dcd311 100644 --- a/modules/private/databases/postgresql.nix +++ b/modules/private/databases/postgresql.nix @@ -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' -- 2.41.0