qbt: tweak

This commit is contained in:
2026-02-20 11:05:53 -05:00
parent 4fe33b9b32
commit 304ad7f308
2 changed files with 30 additions and 4 deletions

View File

@@ -132,6 +132,31 @@
compressor = "zstd"; compressor = "zstd";
supportedFilesystems = [ "f2fs" ]; supportedFilesystems = [ "f2fs" ];
}; };
# BBR congestion control handles variable-latency VPN connections much
# better than CUBIC by probing bandwidth continuously rather than
# reacting to packet loss.
kernelModules = [ "tcp_bbr" ];
kernel.sysctl = {
# Use BBR + fair queuing for smooth throughput through the WireGuard VPN
"net.core.default_qdisc" = "fq";
"net.ipv4.tcp_congestion_control" = "bbr";
# Disable slow-start after idle: prevents TCP from resetting window
# size on each burst cycle (the primary cause of the 0 -> 40 MB/s spikes)
"net.ipv4.tcp_slow_start_after_idle" = 0;
# Larger socket buffers to accommodate the VPN bandwidth-delay product
# (22ms RTT * target throughput). Current 2.5MB max is too small.
"net.core.rmem_max" = 16777216;
"net.core.wmem_max" = 16777216;
"net.ipv4.tcp_rmem" = "4096 87380 16777216";
"net.ipv4.tcp_wmem" = "4096 65536 16777216";
# Higher backlog for the large number of concurrent torrent connections
"net.core.netdev_max_backlog" = 5000;
};
}; };
environment.etc = { environment.etc = {

View File

@@ -48,7 +48,7 @@
serverConfig.BitTorrent = { serverConfig.BitTorrent = {
Session = { Session = {
MaxConnectionsPerTorrent = 100; MaxConnectionsPerTorrent = 50;
MaxUploadsPerTorrent = 10; MaxUploadsPerTorrent = 10;
MaxConnections = -1; MaxConnections = -1;
MaxUploads = -1; MaxUploads = -1;
@@ -57,7 +57,7 @@
# queueing # queueing
QueueingSystemEnabled = true; QueueingSystemEnabled = true;
MaxActiveDownloads = 8; # num of torrents that can download at the same time MaxActiveDownloads = 5; # keep focused: fewer torrents, each gets more bandwidth
MaxActiveUploads = -1; MaxActiveUploads = -1;
MaxActiveTorrents = -1; MaxActiveTorrents = -1;
IgnoreSlowTorrentsForQueueing = true; IgnoreSlowTorrentsForQueueing = true;
@@ -84,8 +84,9 @@
inherit (config.services.qbittorrent.serverConfig.Preferences.Downloads) TempPath; inherit (config.services.qbittorrent.serverConfig.Preferences.Downloads) TempPath;
TempPathEnabled = true; TempPathEnabled = true;
# how many connections per sec # Reduced from 300: that rate floods the VPN tunnel with SYN packets,
ConnectionSpeed = 300; # starving actual data transfer and causing the 0->40MB/s spike pattern.
ConnectionSpeed = 20;
# Automatic Torrent Management: use category save paths for new torrents # Automatic Torrent Management: use category save paths for new torrents
DisableAutoTMMByDefault = false; DisableAutoTMMByDefault = false;