<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Torrenting on Charlie Chiang's blog</title><link>https://charlie0129.github.io/blog/categories/torrenting/</link><description>Recent content in Torrenting on Charlie Chiang's blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Wed, 19 Jun 2024 22:11:00 +0800</lastBuildDate><atom:link href="https://charlie0129.github.io/blog/categories/torrenting/index.xml" rel="self" type="application/rss+xml"/><item><title>高速做种指南</title><link>https://charlie0129.github.io/blog/p/high-speed-seeding-guide/</link><pubDate>Wed, 19 Jun 2024 22:11:00 +0800</pubDate><guid>https://charlie0129.github.io/blog/p/high-speed-seeding-guide/</guid><description>&lt;h2 id="前言">前言
&lt;/h2>&lt;p>由于最近接入了 10Gbps 网络，发现在 PT 做种时，传输速度并没有达到预期的速度，于是优化了一波。本文记录了一些针对高速做种的建议、注意点和技巧。&lt;/p>
&lt;h2 id="硬件条件">硬件条件
&lt;/h2>&lt;h3 id="足够快的网络">足够快的网络
&lt;/h3>&lt;p>做种本质上就是网络传输，快速的网络是做种的基础。&lt;/p>
&lt;h4 id="确保上传带宽">确保上传带宽
&lt;/h4>&lt;p>做种嘛，主要是给别人传输数据，吃的是你的上传带宽，跟下载几乎没有关系，这是最重要的。例如原本 50Mbps 的上传情况下，买一条 100Mbps 的宽带比以下所有的优化都重要。&lt;/p>
&lt;p>但是在中国，一般来说家庭宽带的上行速度都是比较低的。例如，电信的 1000M 宽带，上行速度一般不会超过 100Mbps，通常在 50Mbps 左右。这样的话，你的上传速度就被限制在 6.25MB/s 左右，在这个速度下，其实最主要的瓶颈在于你的上传带宽上，不太需要下面说的硬件/软件优化🫠。你可能需要找不少资源来找到高上传带宽的宽带，例如某些地区的移动宽带会给 IPv6 相当大的上传。你还要注意如何不被运营商认为是 PCDN 而封你的号。&lt;/p>
&lt;p>由于本文聊的是高速做种，针对的是接近 1Gbps 的上传带宽的用户。国外的情况暂且不讨论（高速宽带价格更低，很容易购买到超过 1Gbps 的云服务器、seeding box 等），在国内，拥有高速上传带宽的用户主要有几种情况：&lt;/p>
&lt;ul>
&lt;li>企业用户（例如大型公司、数据中心等），使用价格高昂，上下对等（即下载和上传速度一样快），租云服务器也属于这个范畴；&lt;/li>
&lt;li>高校用户，使用价格较低（对用户来说，对学校来说不是这回事），上下对等；&lt;/li>
&lt;li>其他特殊用户，例如某些地区的移动家庭宽带，500M 宽带上行可以达到 200M。&lt;/li>
&lt;/ul>
&lt;p>如果你是这些用户，那么你的上传带宽可能会达到 1Gbps 甚至更高，这时候就需要考虑下面的硬件/软件优化了。不过估计阅读本文的人大部分是高校教育网用户，低廉的价格超大的上传带宽（&lt;/p>
&lt;p>在本文中，我的接入网络为上下 10Gbps 的教育网 CERNET 对等接入。&lt;/p>
&lt;p>&lt;img src="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/internet.jpg"
width="4032"
height="3024"
srcset="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/internet_hu_6ac1c937881d3925.webp 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/internet_hu_767c108a59fde344.jpg 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/internet_hu_83dc83859f5e5c2a.webp 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/internet_hu_f5250ca49a0565e3.jpg 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/internet_hu_8f0e8942732e023a.webp 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/internet_hu_50f707ef55337ac8.jpg 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/internet_hu_1d48a8e9598cc9bb.webp 2048w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/internet_hu_95d49a8c1453da20.jpg 2048w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/internet_hu_86ce4cb85657c3aa.webp 2560w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/internet_hu_47d74685617f1d3b.jpg 2560w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/internet_hu_ac200fdf6fa3e4d6.webp 4032w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/internet_hu_a16cf42efcc048a5.jpg 4032w"
loading="lazy"
alt="10G 网络接入"
class="gallery-image"
data-flex-grow="133"
data-flex-basis="320px"
>
&lt;/p>
&lt;h4 id="外界可联通">外界可联通
&lt;/h4>&lt;p>大部分情况下，你做种时是别人主动连接你的，所以你的网络需要是可被连接的。&lt;/p>
&lt;p>对于 IPv4 来说：&lt;/p>
&lt;ul>
&lt;li>最好的情况是你拥有一个独立的公网 IP ，这是最简单的情况。如果公网 IP 在你的网卡上，那么你不需要做任何设置。如果公网 IP 在你家的光猫上，那么通过简单的端口映射/UPnP 等就能完成。这种情况国内不常见。&lt;/li>
&lt;li>其次如果你的网络是 NAT1（全锥形 NAT） 的（指国内运营商级 NAT，一般你的光猫上能获取 100.x.x.x 这样的 IP），那么通过一些复杂的奇技淫巧（例如 UDP hole punching）也能实现可被连接。&lt;/li>
&lt;li>最差的情况是你的网络是 NAT4（对称形 NAT） 的，这种情况下，你的网络是不可被连接的，除非你使用一些中继服务器来帮助你穿透。不过这种情况下，因为中继服务器的带宽有限，通常不能达到高速做种的要求，这里不讨论。&lt;/li>
&lt;/ul>
&lt;p>如何判断你是 NAT1 还是 NAT4 ？你可以使用 &lt;a class="link" href="https://github.com/talkiq/pystun3" target="_blank" rel="noopener"
>pystun3&lt;/a>。&lt;/p>
&lt;p>如果你使用 IPv6 做种（常见于教育网），运营商（学校）下发的 IPv6 地址一般都是公网 IP，不需要做任何设置，等同于情况一。&lt;/p>
&lt;p>如果你不确定自己的网络是否可被连接，可以阅读文末注意点。&lt;/p>
&lt;h4 id="peering">Peering
&lt;/h4>&lt;p>在数 Gbps 的高速网络下，你所在的运营商网络和你的种子的 peer 之间的连通性也值得考虑（但没那么重要）。运营商各张网之间，例如电信的 163 骨干网，教育网 CERNET ，甚至国外的运营商等，他们之间互联需要走 BGP ，如果你和你需要连接的用户之间连通性不好，那么你的上传速度可能会受到影响。&lt;/p>
&lt;p>国内一般不需要考虑，这种一般在跨国传输的情况下比较明显，如果你所在的网的国际出口带宽不够，连接国外的 peer 时你会发现你的上传速度上不去。&lt;/p>
&lt;h3 id="足够快的硬盘">足够快的硬盘
&lt;/h3>&lt;p>重要性仅次于网络的是硬盘速度，尤其关注 &lt;strong>随机读&lt;/strong>。一种常见的错误认知是：我的机械硬盘顺序读能有 200MiB/s 那么我就能吃满 1Gbps 的上传带宽应该轻轻松松吧。这是完全错误的，由于做种会产生大量的 &lt;strong>随机读&lt;/strong> ，机械硬盘在这方面是最弱鸡的。&lt;/p>
&lt;p>例如，在 1Gbps 左右上传，大文件做种（活跃数据超过我的内存大小 128GB ）的情况下，能稳定 10k IOPS 直达我的磁盘的读取（例如下图 14k IOPS 的读）。一块 7200 RPM 的 SATA 机械硬盘也就 100 IOPS ，一块 15000RPM 的 SAS 机械硬盘也就 200 IOPS 左右，这有着快 2 个数量级的差距。所以，如果你的硬盘是机械硬盘（HDD, spinning rust :p），建议放弃治疗，一旦内存缓存不够了你的上传速度就 gg 了，这辈子都不可能吃满 1Gbps 的，500Mbps 都够呛。根据我的经验， 3*8TB 的 7200RPM 企业级 HDD RAID5 在活跃数据超过内存缓存（128GB）的情况下也就勉勉强强能吃 200Mbps 的上传带宽（此时磁盘已经 100% busy 了），如果缓存更小的话这个数值甚至更低。&lt;/p>
&lt;p>注意：这里不考虑完全使用内存缓存（因为大部分人都没有几百 GB 的内存）一旦种子活跃数据超过可用的内存缓存大小，硬盘就是你的上传速度的瓶颈。&lt;/p>
&lt;p>&lt;img src="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/iops.png"
width="958"
height="214"
srcset="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/iops_hu_a62be9a100d0d422.webp 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/iops_hu_1c7bb2b6c6347f1c.jpg 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/iops_hu_8372a631afe5c126.webp 958w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/iops_hu_fb7d4a04fe75413b.jpg 958w"
loading="lazy"
alt="1Gbps 上传时 14k IOPS 的读请求"
class="gallery-image"
data-flex-grow="447"
data-flex-basis="1074px"
>
&lt;/p>
&lt;p>&lt;strong>所以高速做种的场景下一定要用 SSD ，最次也需要是 SATA SSD，建议使用更高性能的 NVME SSD 。&lt;/strong>&lt;/p>
&lt;p>本文使用了 3 块 Micron 5400 PRO 1.92TB 的 SSD 组成的 RAID5 。注意，这对于我的网络接入（10 Gbps）的情况下仍然是远远不够的，正常需要高性能 NVME SSD 才行。不过我大部分情况也就 1Gbps 左右，跑不满 10Gbps ，凑合用吧。&lt;/p>
&lt;p>&lt;img src="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ssd.jpg"
width="4032"
height="3024"
srcset="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ssd_hu_71768682229bc521.webp 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ssd_hu_d6fee8c78334f34b.jpg 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ssd_hu_c001fde81315af0a.webp 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ssd_hu_eaf6ee13d78ed765.jpg 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ssd_hu_124fb4010895bbdc.webp 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ssd_hu_6402bceeb8d010e2.jpg 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ssd_hu_b9ce0b7a150e838e.webp 2048w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ssd_hu_9654e30bca52624.jpg 2048w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ssd_hu_1c9820c7300efd22.webp 2560w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ssd_hu_bc736ac201db4abb.jpg 2560w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ssd_hu_cd89dc8be46fa548.webp 4032w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ssd_hu_c9b36e0dd3f1b2c7.jpg 4032w"
loading="lazy"
alt="3*1.92TB SSD"
class="gallery-image"
data-flex-grow="133"
data-flex-basis="320px"
>
&lt;/p>
&lt;p>如果你不确定你的硬盘是否足够快，那么你可以阅读下文判断磁盘 IO 瓶颈的部分。&lt;/p>
&lt;h3 id="足够大的内存">足够大的内存
&lt;/h3>&lt;p>足够大的内存可以提供：&lt;/p>
&lt;ul>
&lt;li>更大的磁盘缓存，减少磁盘压力（高速上传时，SSD 也不一定能跟上）；&lt;/li>
&lt;li>更大的 send buffer ，提高网络传输效率/IO 吞吐；&lt;/li>
&lt;/ul>
&lt;p>一般来说 32GB 左右能够满足需求，本文中使用了 128GB 内存测试。&lt;/p>
&lt;p>&lt;img src="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ram.jpg"
width="3798"
height="2848"
srcset="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ram_hu_c191358532ddc4c2.webp 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ram_hu_9d471c4430e49edf.jpg 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ram_hu_43fe4b0fef2e6b69.webp 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ram_hu_402892627914cb2.jpg 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ram_hu_52d2d5e40026f648.webp 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ram_hu_d724384199af9004.jpg 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ram_hu_2afcdd7fdb60b33.webp 2048w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ram_hu_bc29c00f9d8ef12d.jpg 2048w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ram_hu_6d02889ac6f6666c.webp 2560w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ram_hu_63f9f9dddf15c0b4.jpg 2560w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ram_hu_92a17f68f1a78e67.webp 3798w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ram_hu_3fd62f22e407ab85.jpg 3798w"
loading="lazy"
alt="4*32G 内存"
class="gallery-image"
data-flex-grow="133"
data-flex-basis="320px"
>
&lt;/p>
&lt;h3 id="足够快的网卡">足够快的网卡
&lt;/h3>&lt;p>更好的网卡能够提供更多的 hardware offloading ，减轻 CPU 的负担，提高网络传输效率。一些高端网卡也支持更多的 queue ，提高并发传输能力，例如 CX-4 Lx 支持 64 个 queue ，可以看到这些 queue 上的收发包表示它们在被积极利用（实际上一般软件无法同时用不到这么多，包括 qBittorrent，所以 8 队列的 I350 就够了）。&lt;/p>
&lt;p>&lt;img src="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/cx4lxqueue.png"
width="2740"
height="1586"
srcset="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/cx4lxqueue_hu_87ce5e9f2b42c91c.webp 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/cx4lxqueue_hu_62a5a3e65a27f316.jpg 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/cx4lxqueue_hu_5b4bbc9df213a117.webp 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/cx4lxqueue_hu_b2a214ba7c5f5ee8.jpg 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/cx4lxqueue_hu_542f8196789379d5.webp 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/cx4lxqueue_hu_cf6cd8609c59c3fc.jpg 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/cx4lxqueue_hu_bc6b7143feecacd7.webp 2048w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/cx4lxqueue_hu_48256ba81691ab76.jpg 2048w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/cx4lxqueue_hu_5652cdd9c2b6a3f8.webp 2560w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/cx4lxqueue_hu_a7833ed4ebdb1735.jpg 2560w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/cx4lxqueue_hu_d9217edb15a1e7b7.webp 2740w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/cx4lxqueue_hu_17635e13d599281b.jpg 2740w"
loading="lazy"
alt="网卡队列"
class="gallery-image"
data-flex-grow="172"
data-flex-basis="414px"
>
&lt;/p>
&lt;p>最差也要使用 Intel 的 Gigabit 网卡，例如 I350 、I210 ，更好的可以用 Intel X520/X540 ，甚至 Mellanox ConnectX-4/5/6 等更高端的网卡。不要用 Realtek （小螃蟹）的，在大连接数吃满 1Gbps 的情况下性能很烂。&lt;/p>
&lt;p>例如下图是我的计算机在 700Mbps 下行 1.2Gbps 上行时每秒的收发包数量，约为 170 Kpps 。性能差的网卡是很难达到这个性能的。&lt;/p>
&lt;p>&lt;img src="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/kpps.png"
width="1670"
height="1032"
srcset="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/kpps_hu_77807694310453f9.webp 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/kpps_hu_fddbc5eb561ac6c8.jpg 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/kpps_hu_55fbbdf92302ed4b.webp 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/kpps_hu_a5c85b55ef82325b.jpg 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/kpps_hu_5d7e43d87ebf74d3.webp 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/kpps_hu_b40e6c40d339d6fb.jpg 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/kpps_hu_475920fadb32cc1e.webp 1670w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/kpps_hu_95bc7e52a0b5118f.jpg 1670w"
loading="lazy"
alt="1.5Gbps 时每秒的收发包数量"
class="gallery-image"
data-flex-grow="161"
data-flex-basis="388px"
>
&lt;/p>
&lt;p>本文中使用了 Mellanox ConnectX-4 Lx 25G (CX4121A) 网卡（虽然现在被 NVIDIA 收购了，不过我还是习惯称之为 Mellanox ）。&lt;/p>
&lt;p>&lt;img src="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/nic.jpg"
width="4032"
height="3024"
srcset="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/nic_hu_1849ad8ebc2844d1.webp 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/nic_hu_10f8f6bb31259317.jpg 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/nic_hu_c863a182290b84f4.webp 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/nic_hu_2264a97cb298ba32.jpg 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/nic_hu_b34ed9be158631ed.webp 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/nic_hu_dda5cd1ddcbab175.jpg 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/nic_hu_6268e08092eb7de0.webp 2048w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/nic_hu_b19c563ca0f327b3.jpg 2048w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/nic_hu_6d8a8d1d0119eb94.webp 2560w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/nic_hu_32cee5281466fa60.jpg 2560w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/nic_hu_7d3c99e43441cdc6.webp 4032w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/nic_hu_38190a6091d312bd.jpg 4032w"
loading="lazy"
alt="Mellanox ConnectX-4 Lx 25G"
class="gallery-image"
data-flex-grow="133"
data-flex-basis="320px"
>
&lt;/p>
&lt;h3 id="足够快的-cpu">足够快的 CPU
&lt;/h3>&lt;p>一个正常的现代 CPU 即可，例如 Intel Core i5-12500 。请不要使用树莓派、老掉牙的 CPU（例如 Intel Xeon E5-2403 v2 这种 4C4T 1.8GHz 的垃圾），这种情况下，你的 CPU 仍然是整个系统的瓶颈，特别是在高速上传时，CPU 的负载会很高。网卡越烂，上传速度越快，你就需要越好的 CPU 来处理。&lt;/p>
&lt;p>本文中使用了国产的飞腾 2000+ ，虽然看起来有 64 个 ARM64 核心，但是性能还是比较烂的，不太够说实话，用起来跟只有 10 个核的 i9-10900K 也差的比较多。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;span class="lnt">25
&lt;/span>&lt;span class="lnt">26
&lt;/span>&lt;span class="lnt">27
&lt;/span>&lt;span class="lnt">28
&lt;/span>&lt;span class="lnt">29
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">Architecture: aarch64
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">CPU op-mode(s): 64-bit
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Byte Order: Little Endian
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Address sizes: 44 bits physical, 48 bits virtual
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">CPU(s): 64
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">On-line CPU(s) list: 0-63
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Thread(s) per core: 1
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Core(s) per socket: 64
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Socket(s): 1
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">NUMA node(s): 8
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Vendor ID: Phytium
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">BIOS Vendor ID: Phytium
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Model: 2
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Model name: FTC662
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">BIOS Model name: FT-2000+/64
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Stepping: 0x1
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">BogoMIPS: 100.00
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">L1d cache: 2 MiB
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">L1i cache: 2 MiB
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">L2 cache: 512 MiB
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">NUMA node0 CPU(s): 0-7
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">NUMA node1 CPU(s): 8-15
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">NUMA node2 CPU(s): 16-23
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">NUMA node3 CPU(s): 24-31
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">NUMA node4 CPU(s): 32-39
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">NUMA node5 CPU(s): 40-47
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">NUMA node6 CPU(s): 48-55
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">NUMA node7 CPU(s): 56-63
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Flags: fp asimd evtstrm crc32 cpuid
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h2 id="软件调优">软件调优
&lt;/h2>&lt;h3 id="qbittorrent">qBittorrent
&lt;/h3>&lt;h4 id="基本设置">基本设置
&lt;/h4>&lt;ul>
&lt;li>提升连接限制。如果你的网络/磁盘足够强劲，你可以去除所有的连接限制：&lt;/li>
&lt;/ul>
&lt;p>&lt;img src="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbconn.png"
width="1214"
height="392"
srcset="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbconn_hu_58678337e5f2ed18.webp 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbconn_hu_e5e23de374656a6d.jpg 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbconn_hu_c5d1250f5b48fb1d.webp 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbconn_hu_89b1ba58012bc366.jpg 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbconn_hu_6442abab20c802f8.webp 1214w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbconn_hu_dd8053d8272ca36c.jpg 1214w"
loading="lazy"
alt="qBittorrent 连接限制"
class="gallery-image"
data-flex-grow="309"
data-flex-basis="743px"
>
&lt;/p>
&lt;ul>
&lt;li>提高队列。磁盘性能足够的情况下，可以同时让多个种子做种，你也可以直接关闭：&lt;/li>
&lt;/ul>
&lt;p>&lt;img src="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbqueue.png"
width="1214"
height="348"
srcset="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbqueue_hu_51f5f9e10d26bc57.webp 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbqueue_hu_1057e3f4efadcddb.jpg 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbqueue_hu_54ef5b83b29b38cc.webp 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbqueue_hu_d94a596255581773.jpg 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbqueue_hu_4f3838a1b6c6c870.webp 1214w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbqueue_hu_172e404a719f51e3.jpg 1214w"
loading="lazy"
alt="qBittorrent 队列"
class="gallery-image"
data-flex-grow="348"
data-flex-basis="837px"
>
&lt;/p>
&lt;ul>
&lt;li>提高内存限制。虽然目前（2024 年 6 月）这个设置只对 Windows 有效，不过设置了也无妨：&lt;/li>
&lt;/ul>
&lt;p>&lt;img src="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbramlim.png"
width="1214"
height="326"
srcset="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbramlim_hu_fb53d4fefcd0da47.webp 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbramlim_hu_32b1a80a9660462f.jpg 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbramlim_hu_6d3cf036f929c20d.webp 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbramlim_hu_cecaab0e51904a91.jpg 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbramlim_hu_b6c7fc17dadeb429.webp 1214w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbramlim_hu_8c7f1e8080e36ae6.jpg 1214w"
loading="lazy"
alt="qBittorrent 内存限制"
class="gallery-image"
data-flex-grow="372"
data-flex-basis="893px"
>
&lt;/p>
&lt;h4 id="libtorrent-调优">libtorrent 调优
&lt;/h4>&lt;p>我们针对 libtorrent &amp;gt;=2.0 版本，1 Gbps 左右的对等带宽， 64G 左右内存的用户，其他用户请酌情调整以下参数。&lt;/p>
&lt;ul>
&lt;li>&lt;code>aio_threads&lt;/code> &lt;em>Asynchronous I/O threads&lt;/em> 默认 10 。例如在高速下载时，由于需要把下载的数据都坐 SHA1/SHA256 校验，CPU 可能存在瓶颈。提高这个值可以减轻让多核 CPU 并行处理。常见的说法是设置为 4 *线程数 。由于我使用了 64 核的处理器，256 显得过大了，所以我设置为 64 。&lt;/li>
&lt;li>&lt;code>file_pool_size&lt;/code> &lt;em>File pool size&lt;/em> 默认 40。一个 session 直接同时打开多少个文件。大量做种时，这个值设置的太小会导致频繁的文件打开/关闭，降低性能。而又设置的太大会超过一个进程的文件描述符限制（ulimit -n），导致打开文件失败。我设置为 900 （Linux 默认的文件描述符限制是 1024），留一些给其他的文件使用。&lt;/li>
&lt;li>&lt;code>max_queued_disk_bytes&lt;/code> &lt;em>Disk queue size&lt;/em> 默认 1024 KiB 。这个值表示磁盘 IO 写入队列的大小，如果达到了这个上限，libtorrent 就会停止下载，直到磁盘完成了一部分写入。这个值设置的太小会导致下载性能下降，设置的太大会导致内存占用过高。我设置为 262144 KiB 。&lt;/li>
&lt;li>&lt;code>default-disk-io-constructor&lt;/code> &lt;em>Disk IO type&lt;/em> 默认 &lt;code>mmap_disk_io_constructor&lt;/code> 。这个值表示 libtorrent 使用的磁盘 IO 类型，&lt;code>posix_disk_io_constructor&lt;/code> 是使用 POSIX IO ，&lt;code>mmap&lt;/code> 是使用 mmap ，mmap 在 kernel 里有大量优化，建议只用 mmap （Memory Mapped Files）。如果你看到了大量内存占用，请看文末注意点。&lt;/li>
&lt;li>&lt;code>disk_io_write_mode&lt;/code> 和 &lt;code>disk_io_read_mode&lt;/code> 默认 &lt;code>enable_os_cache&lt;/code> 。维持默认。&lt;/li>
&lt;li>&lt;code>piece_extent_affinity&lt;/code> &lt;em>Use piece extent affinity&lt;/em> 默认 &lt;code>0&lt;/code> 。这个值表示 libtorrent 会尽量下载相邻的 piece ，提高磁盘 IO 吞吐。建议打开。&lt;/li>
&lt;li>&lt;code>suggest_mode&lt;/code> &lt;em>Send upload piece suggestions&lt;/em> 默认 &lt;code>no_piece_suggestions&lt;/code> 。这个值表示会告诉从我这边下载的 peer 建议下载那些在我读缓存里的 piece 而不是其他的没在缓存里的，可以提高做种速度减少磁盘 IO 。建议打开。&lt;/li>
&lt;li>&lt;code>send_buffer_low_watermark&lt;/code> &lt;em>Send buffer low watermark&lt;/em> 默认 10 KiB。最小的目标 send buffer 大小（包括等待磁盘读取的字节数）。这实际上是初始窗口大小，它决定了我们能够多快地提高发送速率。我设置为 4096 KiB。&lt;/li>
&lt;li>&lt;code>send_buffer_watermark&lt;/code> &lt;em>Send buffer watermark&lt;/em> 默认 500 KiB。如果发送缓冲区的字节数少于它，将从磁盘额外读取 16 KiB 的数据到缓冲区。这是上限，所以实际大小可能小于它。过小影响上传速率，过大浪费内存。我设置为 32768 KiB。&lt;/li>
&lt;li>&lt;code>send_buffer_watermark_factor&lt;/code> &lt;em>Send buffer watermark factor&lt;/em> 默认 50。这是个百分比，peer 的上传速率乘以这个因子以获得 实际的 send_buffer_watermark，但是不超过上面的 send_buffer_watermark。对于高速连接，设置得更高可以提高上传性能和磁盘吞吐，设置得过高可能会浪费内存并且偏好读。我的目的是高速做种，我设置为 200。&lt;/li>
&lt;li>&lt;code>connection_speed&lt;/code> &lt;em>Outgoing connections per second&lt;/em> 默认 30。这个值表示每秒最多建立多少个出站连接，影响去下载 peer 那边数据的效率。我设置为 500 。&lt;/li>
&lt;li>&lt;code>listen_queue_size&lt;/code> &lt;em>Socket backlog size&lt;/em> 默认 5 。它是传递给监听 socket listen() 的值，用于指定未处理传入连接的队列长度。当我们不积极等待连接被接受时，这些连接将会被排队。由于我们是大带宽高性能做种，我设置为 3000。&lt;/li>
&lt;li>&lt;code>mixed_mode_algorithm&lt;/code> &lt;em>μTP-TCP mixed mode algorithm&lt;/em> 默认 &lt;code>prefer_tcp&lt;/code> 。这个值用于确定在同时存在 TCP 和 uTP 连接时如何处理这两种连接。我们不需要为 uTP 做出让步，所以设置为 &lt;code>prefer_tcp&lt;/code> 。&lt;/li>
&lt;li>&lt;code>allow_multiple_connections_per_ip&lt;/code> &lt;em>Allow multiple connections from the same IP address&lt;/em> 默认 &lt;code>true&lt;/code> 。这个值表示是否允许同一个 IP 建立多个连接。我们不需要限制，所以设置为 &lt;code>true&lt;/code> 。&lt;/li>
&lt;li>&lt;code>choking_algorithm&lt;/code> &lt;em>Upload slots behavior&lt;/em> 使用 &lt;code>fixed_slots_choker&lt;/code>。&lt;/li>
&lt;li>&lt;code>seed_choking_algorithm&lt;/code> &lt;em>Upload choking algorithm&lt;/em> 使用 &lt;code>fastest_upload&lt;/code>。&lt;/li>
&lt;li>&lt;code>max_out_request_queue&lt;/code> &lt;em>Maximum outstanding requests to a single peer&lt;/em> 默认 500 。表示发给 peer 的最大未处理请求数。我设置为 2000 。&lt;/li>
&lt;/ul>
&lt;h3 id="自动下载自动-announce">自动下载/自动 Announce
&lt;/h3>&lt;p>一般种子流量最大的时候为刚发布之后，为了在种子发布后能够快速下载，抢占最早的上传机会。我们需要自动下载种子，然后立即开始做种。称之为 &lt;a class="link" href="https://www.reddit.com/r/seedboxes/comments/9brx3b/comment/e570unm/" target="_blank" rel="noopener"
>racing&lt;/a> 。&lt;/p>
&lt;p>这里我使用了自己编写的脚本，你也可以用 autodl-irssi 等工具。&lt;/p>
&lt;h2 id="注意点">注意点
&lt;/h2>&lt;h3 id="判断磁盘-io-瓶颈">判断磁盘 IO 瓶颈
&lt;/h3>&lt;p>使用 &lt;code>iostat -xm 1&lt;/code>，找到存放种子数据的盘，特别关注最后的百分比，接近 100% 表示你的磁盘是瓶颈了。&lt;/p>
&lt;p>&lt;img src="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/iobusy.png"
width="1592"
height="548"
srcset="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/iobusy_hu_8e840d1701b93e6d.webp 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/iobusy_hu_94e9ad173e6d24c9.jpg 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/iobusy_hu_14f1a8ded2e0aeaa.webp 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/iobusy_hu_2b548b2ad414ff64.jpg 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/iobusy_hu_6fc427ebc2151ce.webp 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/iobusy_hu_314aa34dc66cf6b8.jpg 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/iobusy_hu_500cb34a123095c6.webp 1592w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/iobusy_hu_e248c56d4a19ab45.jpg 1592w"
loading="lazy"
alt="iostat 查看磁盘 busy%"
class="gallery-image"
data-flex-grow="290"
data-flex-basis="697px"
>
&lt;/p>
&lt;p>你也可以在 htop 中看到 IO 的情况（在 Setup 的 Meter 中添加 Disk IO ）。htop 中的百分比是所有磁盘的合计，如果的下载盘是软 RAID 你有可能看到超过 100% 的情况，我这里是单个设备（硬 RAID），所以图中 99.1% 表示 IO 已经满了，我的硬盘已经跟不上了。&lt;/p>
&lt;p>&lt;img src="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopio.png"
width="1764"
height="1058"
srcset="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopio_hu_8f24ef2035839054.webp 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopio_hu_30d6f43da75aa995.jpg 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopio_hu_df21ce627ddf944a.webp 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopio_hu_11af5105f7251320.jpg 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopio_hu_32f3c744550c6b9a.webp 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopio_hu_8dbd2d5f6ad8a85b.jpg 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopio_hu_d099b6907945a3a4.webp 1764w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopio_hu_803d2dbdec47c5fb.jpg 1764w"
loading="lazy"
alt="iostat 查看磁盘 busy%"
class="gallery-image"
data-flex-grow="166"
data-flex-basis="400px"
>
&lt;/p>
&lt;p>上面两张图是我使用的 3 块 SSD 阵列在 1~2 Gbps 上传，IO 爆发时的情况，可以看到其实 IO 已经快满了。如果你发现你的 busy% 接近 100% 了，那么你的磁盘 IO 就是瓶颈了，建议更换更好更快的 SSD。&lt;/p>
&lt;p>如果你用的是机械硬盘，应该是轻轻松松全程 100% ，完全撑不住 :p&lt;/p>
&lt;h3 id="判断网络-io-瓶颈">判断网络 IO 瓶颈
&lt;/h3>&lt;p>首先查看你的上传/下载速度是否超过了你的互联网带宽/物理网络接口的速度。你可以在 htop 中看到（记得在 Setup -&amp;gt; Meters 中添加 Network IO ）如果超过了，那么没什么办法，除非换网络/换网卡。如果没有，可以继续往下看。&lt;/p>
&lt;p>&lt;img src="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopnet.png"
width="2722"
height="922"
srcset="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopnet_hu_39b730d379e2537e.webp 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopnet_hu_aff10b94c3300115.jpg 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopnet_hu_a365a3b4adb354e.webp 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopnet_hu_af3b6755ca9f1180.jpg 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopnet_hu_af0c19b2ef7319a8.webp 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopnet_hu_69ee16580ff6ca.jpg 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopnet_hu_278ec5f58bc76014.webp 2048w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopnet_hu_140bd045cd9605b5.jpg 2048w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopnet_hu_ff96964e602d8e34.webp 2560w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopnet_hu_3c33761982f188bc.jpg 2560w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopnet_hu_86c2f57bbab57aed.webp 2722w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopnet_hu_2b75c24c58f08f20.jpg 2722w"
loading="lazy"
alt="查看网络 IO "
class="gallery-image"
data-flex-grow="295"
data-flex-basis="708px"
>
&lt;/p>
&lt;p>如果你看到 softirq 占用过高，那么你的网络 IO 可能是瓶颈了，建议更换更好的 CPU 或网卡。&lt;/p>
&lt;p>例如你可以在 htop 中看到紫色的 softirq 的占用（注意在 Setup -&amp;gt; Display Options 中勾选 Detailed CPU time ）。&lt;/p>
&lt;p>&lt;img src="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopsi.png"
width="2102"
height="1166"
srcset="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopsi_hu_3af233a81c09fd40.webp 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopsi_hu_5fd4489618a27bc7.jpg 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopsi_hu_980275abcfcfd458.webp 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopsi_hu_c6d3d601f305cd5e.jpg 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopsi_hu_94b32dc2125c154f.webp 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopsi_hu_6717b7ce1455fe2d.jpg 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopsi_hu_c3cc8d5dfb232735.webp 2048w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopsi_hu_a758ab25c55721a.jpg 2048w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopsi_hu_a0f8ebf1b6d4403.webp 2102w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopsi_hu_69f253ef2190ffaf.jpg 2102w"
loading="lazy"
alt="查看 softirq"
class="gallery-image"
data-flex-grow="180"
data-flex-basis="432px"
>
&lt;/p>
&lt;p>如果你发现某个/几个核心的 softirq 占满了，那么你的网络 IO 可能是瓶颈了。&lt;/p>
&lt;p>&lt;img src="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopsifull.png"
width="2102"
height="1220"
srcset="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopsifull_hu_4a20a810e483c3ad.webp 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopsifull_hu_8383303e10b8a357.jpg 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopsifull_hu_c48bbaa0dab1f4f4.webp 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopsifull_hu_6d14b03095505c1a.jpg 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopsifull_hu_3bc5b14ec904fc34.webp 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopsifull_hu_404bd3920b676aad.jpg 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopsifull_hu_7d42f4a53a1727b8.webp 2048w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopsifull_hu_a2e7e58ddcd5d0fc.jpg 2048w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopsifull_hu_377b6086792d1fd8.webp 2102w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopsifull_hu_eb0b11315ab54899.jpg 2102w"
loading="lazy"
alt="异常 softirq"
class="gallery-image"
data-flex-grow="172"
data-flex-basis="413px"
>
&lt;/p>
&lt;p>正常情况你不应该看到很高的 softirq 占用。&lt;/p>
&lt;p>&lt;img src="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopnormal.png"
width="2740"
height="1586"
srcset="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopnormal_hu_181ca5070d41f539.webp 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopnormal_hu_e34cf6dc9e800900.jpg 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopnormal_hu_de1953cdfa086a0a.webp 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopnormal_hu_ad94b0c41228fd7.jpg 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopnormal_hu_a5f626a96dc36b4f.webp 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopnormal_hu_c855769df5351d79.jpg 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopnormal_hu_3fb88060b81d7b.webp 2048w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopnormal_hu_98568b3595860d40.jpg 2048w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopnormal_hu_b989fa81ff85e195.webp 2560w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopnormal_hu_2380bfeb46069303.jpg 2560w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopnormal_hu_82aa9f4e705e30b2.webp 2740w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/htopnormal_hu_8ad82b1db7fbcbc3.jpg 2740w"
loading="lazy"
alt="正常 softirq"
class="gallery-image"
data-flex-grow="172"
data-flex-basis="414px"
>
&lt;/p>
&lt;h3 id="判断-cpu-瓶颈">判断 CPU 瓶颈
&lt;/h3>&lt;p>一般来说，通过看 htop 即可。注意，你不仅要看全部的 CPU 核心占用，&lt;strong>还要看单个核心的占用&lt;/strong>。如果你发现某个核占满了（这种情况更易发生）、整体 CPU 占用很高（目前 CPU 核心很多了，这个不太容易发生），那么你的 CPU 可能是瓶颈了。同时，看到 CPU 占用很高时，注意上面一节提到的 softirq 占用，这可能是网络 IO 的瓶颈。&lt;/p>
&lt;p>例如在我的计算机上，我偶尔在 IO 爆发时能见到 CPU 占用 5000%+ 的峰值，这说明我的CPU对我的使用场景来说不太行。（图中其实你会发现我的磁盘IO也满了。。）&lt;/p>
&lt;p>&lt;img src="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ft2000cpuusage.png"
width="2722"
height="808"
srcset="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ft2000cpuusage_hu_9d559c0eb7270955.webp 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ft2000cpuusage_hu_f4a3a2afe1c20c29.jpg 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ft2000cpuusage_hu_a7e748e9146256a9.webp 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ft2000cpuusage_hu_82963b4c241d3c9.jpg 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ft2000cpuusage_hu_86f3e3b76f78431.webp 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ft2000cpuusage_hu_58a9171ecd19a249.jpg 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ft2000cpuusage_hu_c979e156553852b6.webp 2048w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ft2000cpuusage_hu_34d7e33952be4024.jpg 2048w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ft2000cpuusage_hu_1d74d058da36678b.webp 2560w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ft2000cpuusage_hu_f1e32d7d9424f117.jpg 2560w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ft2000cpuusage_hu_a4988cfe170de731.webp 2722w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/ft2000cpuusage_hu_e0d2c987d175cb1c.jpg 2722w"
loading="lazy"
alt="FT2000 在偶尔 IO 爆发时 qBittorrent 4000%&amp;#43; 的 CPU 使用率"
class="gallery-image"
data-flex-grow="336"
data-flex-basis="808px"
>
&lt;/p>
&lt;h3 id="qbittorrent-内存占用过大">qBittorrent 内存占用过大？
&lt;/h3>&lt;p>如果你发现 qBittorrent 的内存占用过大，你不应该担心。这是 mmap 的特性，它会把文件映射到内存中，这样可以减少磁盘 IO ，提高性能。如果你关注总的内存占用，你会发现它并不会增加。自从 libtorrnet 2.0 使用 mmap 以来，有很多用户 &lt;a class="link" href="https://github.com/arvidn/libtorrent/issues/6667" target="_blank" rel="noopener"
>反馈内存占用过大&lt;/a> ，但是这是正常的。&lt;/p>
&lt;p>例如我的计算机上，qBittorrent 的内存占用超过了 80GB ，但是总的内存占用只有 5GB。&lt;/p>
&lt;p>&lt;img src="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbhighram.png"
width="2102"
height="1166"
srcset="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbhighram_hu_70a9efbe71026e87.webp 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbhighram_hu_e3dfd41e12515fbe.jpg 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbhighram_hu_ce62f2236ae330c2.webp 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbhighram_hu_90c9189215d4c444.jpg 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbhighram_hu_3f52a51b9e8ceda6.webp 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbhighram_hu_13adb9beee421a9a.jpg 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbhighram_hu_471f9a2421ec67fe.webp 2048w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbhighram_hu_187bbb8a73d620e2.jpg 2048w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbhighram_hu_ba8802af2b1bcc35.webp 2102w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/qbhighram_hu_1968d432d6ec3563.jpg 2102w"
loading="lazy"
alt="qBittorrent 内存占用示例"
class="gallery-image"
data-flex-grow="180"
data-flex-basis="432px"
>
&lt;/p>
&lt;h3 id="检测是否可被连接">检测是否可被连接
&lt;/h3>&lt;p>你可以使用外网 TCPing 来检查，例如一些网站可以替你检测： &lt;a class="link" href="https://www.itdog.cn/tcping" target="_blank" rel="noopener"
>IPv4&lt;/a>、&lt;a class="link" href="https://www.itdog.cn/tcping_ipv6" target="_blank" rel="noopener"
>IPv6&lt;/a> 。输入你的公网 IP 和端口，如果各地均能够 ping 通，那么你是可被连接的。&lt;/p>
&lt;p>&lt;img src="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/tcping.png"
width="2458"
height="1080"
srcset="https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/tcping_hu_c796628aa02a8bd7.webp 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/tcping_hu_f101d91e676d272f.jpg 480w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/tcping_hu_914572234e2e0626.webp 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/tcping_hu_d3f4d698c48b4105.jpg 1024w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/tcping_hu_ab5d8f75d003e7b0.webp 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/tcping_hu_178cf78b979e3329.jpg 1536w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/tcping_hu_d6429e75146e855f.webp 2048w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/tcping_hu_1070a1e6ddafb629.jpg 2048w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/tcping_hu_73fff28e0081cb5a.webp 2458w, https://charlie0129.github.io/blog/p/high-speed-seeding-guide/images/tcping_hu_c118bdf43f78eb78.jpg 2458w"
loading="lazy"
alt="外网 TCPing"
class="gallery-image"
data-flex-grow="227"
data-flex-basis="546px"
>
&lt;/p>
&lt;h3 id="上传仍然不及预期">上传仍然不及预期？
&lt;/h3>&lt;p>如果你各方面都确认没有瓶颈（网络、磁盘、CPU 等）但是上传速度仍然很慢，那么可能是你的种子不够热门，或者说你的 peer 的下行太慢了。这方面除了选择热门的种子（做种人少，下载人多，提高下载的 peer 连接你的机会），其实也没什么办法了。&lt;/p>
&lt;p>因为你的上传是需要 peer 来连接你的，这就不是你能决定的事，可遇而不可求。举个例子，如果想跑满 10Gbps 的上传，那么需要 10 个 peer ，每个都以 1Gbps 的速度从你这拉数据，这是非常困难的。首先，别人的下载速度很少有 1G 的；其次，做种的人几十个，别人不可能只从你这下载，很可能从几十个不同的 peer 那边下载，一下就分散了，一个 peer 到你这只有几十分之一的流量了。&lt;/p>
&lt;p>所以，这种情况下，除了选择合适的种子提高 peer 连接你的机会也没什么办法了。合适的种子通常是刚发布、热门、做种人少、下载人多的种子。&lt;/p></description></item></channel></rss>