From: Ismaƫl Bouya Date: Fri, 20 Dec 2019 00:51:17 +0000 (+0100) Subject: Optimize mysql and postgresql for write IO X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FConfig%2FNix.git;a=commitdiff_plain;h=0907cf1ba08ad04cff9b1fe805ac6f2072c24142 Optimize mysql and postgresql for write IO --- 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'