From 477b5abfa82e628826528a700d89010aa797c1ed Mon Sep 17 00:00:00 2001 From: coolneng Date: Thu, 27 Jul 2023 00:14:13 +0200 Subject: [PATCH] Improve Syncthing performance --- configuration.nix | 8 ++++++-- modules/datasync.nix | 8 +++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/configuration.nix b/configuration.nix index e2d103d..015d296 100644 --- a/configuration.nix +++ b/configuration.nix @@ -94,8 +94,12 @@ with pkgs; # Keep logs for a week services.journald.extraConfig = "MaxRetentionSec=1week"; - # Increase inotify limits - boot.kernel.sysctl = { "fs.inotify.max_user_watches" = 204800; }; + # Increase inotify limits and maximum buffer size + boot.kernel.sysctl = { + "fs.inotify.max_user_watches" = 204800; + "net.core.rmem_max" = 2500000; + "net.core.wmem_max" = 2500000; + }; # MOTD message programs.fish.interactiveShellInit = "${./scripts/motd.sh}"; diff --git a/modules/datasync.nix b/modules/datasync.nix index 3a0673b..6e16b88 100644 --- a/modules/datasync.nix +++ b/modules/datasync.nix @@ -7,13 +7,19 @@ guiAddress = "0.0.0.0:8384"; dataDir = "/vault/syncthing"; key = config.age.secrets.syncthing.path; - extraOptions = { options.maxFolderConcurrency = 1; }; devices = { panacea.id = "NF4SYEJ-RSGPDEF-CDEYC3A-JWZMKNC-KG4FVQP-CZ5HRFY-XM22BZD-N7B6VAH"; caravanserai.id = "MIRF73R-S7AV47R-VLWZUK2-TFCVQPV-FRYCPND-Y4VR3W2-ZAIQXZD-JAEQCAD"; }; + extraOptions = { + options = { + maxFolderConcurrency = 4; + progressUpdateIntervalS = -1; + caseSensitiveFS = true; + }; + }; folders = { Documents = { id = "wusdj-bfjkr";