Compare commits

...

4 Commits

Author SHA1 Message Date
dcb0e83d6c qbt: tune 2026-03-02 23:33:55 -05:00
57080293bb zfs: tuning 2026-03-02 23:33:15 -05:00
b653debbae qbt: disable UPnP 2026-03-02 20:01:54 -05:00
dfe5392543 qbt: delete incomplete subvolume + tweaks 2026-03-02 14:22:17 -05:00
3 changed files with 35 additions and 9 deletions

View File

@@ -157,6 +157,9 @@
# Higher backlog for the large number of concurrent torrent connections # Higher backlog for the large number of concurrent torrent connections
"net.core.netdev_max_backlog" = 5000; "net.core.netdev_max_backlog" = 5000;
# Faster cleanup of dead connections from torrent peer churn
"net.ipv4.tcp_fin_timeout" = 15; # default 60
"net.ipv4.tcp_tw_reuse" = 1;
# Minecraft server optimizations # Minecraft server optimizations
# Disable autogroup for better scheduling of game server threads # Disable autogroup for better scheduling of game server threads

View File

@@ -27,13 +27,17 @@ in
boot.kernelParams = boot.kernelParams =
let let
gb = 20; gb = 32;
mb = gb * 1000; mb = gb * 1000;
kb = mb * 1000; kb = mb * 1000;
b = kb * 1000; b = kb * 1000;
in in
[ [
"zfs.zfs_arc_max=${builtins.toString b}" "zfs.zfs_arc_max=${builtins.toString b}"
"zfs.zfs_txg_timeout=30" # longer TXG open time = larger sequential writes = better HDD throughput
"zfs.zfs_dirty_data_max=8589934592" # 8GB dirty data buffer (default 4GB) for USB HDD write smoothing
"zfs.zfs_delay_min_dirty_percent=80" # delay write throttling until 80% dirty (default 60%)
"zfs.zfs_vdev_async_write_max_active=30" # more concurrent async writes to vdevs (default 10)
]; ];
boot.supportedFilesystems = [ "zfs" ]; boot.supportedFilesystems = [ "zfs" ];

View File

@@ -10,8 +10,6 @@
imports = [ imports = [
(lib.serviceMountWithZpool "qbittorrent" service_configs.zpool_hdds [ (lib.serviceMountWithZpool "qbittorrent" service_configs.zpool_hdds [
service_configs.torrents_path service_configs.torrents_path
config.services.qbittorrent.serverConfig.Preferences.Downloads.TempPath
]) ])
(lib.serviceMountWithZpool "qbittorrent" service_configs.zpool_ssds [ (lib.serviceMountWithZpool "qbittorrent" service_configs.zpool_ssds [
"${config.services.qbittorrent.profileDir}/qBittorrent" "${config.services.qbittorrent.profileDir}/qBittorrent"
@@ -55,22 +53,22 @@
serverConfig.BitTorrent = { serverConfig.BitTorrent = {
Session = { Session = {
MaxConnectionsPerTorrent = 50; MaxConnectionsPerTorrent = 100;
MaxUploadsPerTorrent = 10; MaxUploadsPerTorrent = 15;
MaxConnections = -1; MaxConnections = -1;
MaxUploads = -1; MaxUploads = -1;
MaxActiveCheckingTorrents = 5; MaxActiveCheckingTorrents = 2; # reduce disk pressure from concurrent hash checks
# queueing # queueing
QueueingSystemEnabled = true; QueueingSystemEnabled = true;
MaxActiveDownloads = 5; # keep focused: fewer torrents, each gets more bandwidth MaxActiveDownloads = 15;
MaxActiveUploads = -1; MaxActiveUploads = -1;
MaxActiveTorrents = -1; MaxActiveTorrents = -1;
IgnoreSlowTorrentsForQueueing = true; IgnoreSlowTorrentsForQueueing = true;
GlobalUPSpeedLimit = 0; GlobalUPSpeedLimit = 0;
GlobalDLSpeedLimit = 0; GlobalDLSpeedLimit = 10000;
# Alternate speed limits for when Jellyfin is streaming # Alternate speed limits for when Jellyfin is streaming
AlternativeGlobalUPSpeedLimit = 500; # 500 KB/s when throttled AlternativeGlobalUPSpeedLimit = 500; # 500 KB/s when throttled
@@ -91,7 +89,10 @@
inherit (config.services.qbittorrent.serverConfig.Preferences.Downloads) TempPath; inherit (config.services.qbittorrent.serverConfig.Preferences.Downloads) TempPath;
TempPathEnabled = true; TempPathEnabled = true;
ConnectionSpeed = 200; ConnectionSpeed = 100;
SaveResumeDataInterval = 300; # save resume data every 5 min (default 60s)
ResumeDataStorageType = "SQLite"; # SQLite is more efficient than legacy per-file .fastresume storage
# Automatic Torrent Management: use category save paths for new torrents # Automatic Torrent Management: use category save paths for new torrents
DisableAutoTMMByDefault = false; DisableAutoTMMByDefault = false;
@@ -102,6 +103,22 @@
PieceExtentAffinity = true; PieceExtentAffinity = true;
SuggestMode = true; SuggestMode = true;
CoalesceReadWrite = true; CoalesceReadWrite = true;
# max_queued_disk_bytes: the max bytes waiting in the disk I/O queue.
# When this limit is reached, peer connections stop reading from their
# sockets until the disk thread catches up -- causing the spike-then-zero
# pattern. Default is 1MB; high_performance_seed() uses 7MB.
# 64MB is above the preset but justified for slow raidz1 HDD random writes
# where ZFS txg commits cause periodic I/O stalls.
DiskQueueSize = 67108864; # 64MB
# === Network buffer tuning (from libtorrent high_performance_seed preset) ===
# "always stuff at least 1 MiB down each peer pipe, to quickly ramp up send rates"
SendBufferLowWatermark = 1024; # 1MB (KiB) -- matches high_performance_seed
# "of 500 ms, and a send rate of 4 MB/s, the upper limit should be 2 MB"
SendBufferWatermark = 3072; # 3MB (KiB) -- matches high_performance_seed
# "put 1.5 seconds worth of data in the send buffer"
SendBufferWatermarkFactor = 150; # percent -- matches high_performance_seed
}; };
Network = { Network = {
@@ -109,6 +126,8 @@
# port forwarding # port forwarding
PortForwardingEnabled = false; PortForwardingEnabled = false;
}; };
Session.UseUPnP = false;
}; };
}; };