qbt: tweak
This commit is contained in:
@@ -132,6 +132,31 @@
|
||||
compressor = "zstd";
|
||||
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 = {
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
|
||||
serverConfig.BitTorrent = {
|
||||
Session = {
|
||||
MaxConnectionsPerTorrent = 100;
|
||||
MaxConnectionsPerTorrent = 50;
|
||||
MaxUploadsPerTorrent = 10;
|
||||
MaxConnections = -1;
|
||||
MaxUploads = -1;
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
# queueing
|
||||
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;
|
||||
MaxActiveTorrents = -1;
|
||||
IgnoreSlowTorrentsForQueueing = true;
|
||||
@@ -84,8 +84,9 @@
|
||||
inherit (config.services.qbittorrent.serverConfig.Preferences.Downloads) TempPath;
|
||||
TempPathEnabled = true;
|
||||
|
||||
# how many connections per sec
|
||||
ConnectionSpeed = 300;
|
||||
# Reduced from 300: that rate floods the VPN tunnel with SYN packets,
|
||||
# starving actual data transfer and causing the 0->40MB/s spike pattern.
|
||||
ConnectionSpeed = 20;
|
||||
|
||||
# Automatic Torrent Management: use category save paths for new torrents
|
||||
DisableAutoTMMByDefault = false;
|
||||
|
||||
Reference in New Issue
Block a user