From 338ab8746e2640feb8be7f5f7fc4fc0baf2ec5dd Mon Sep 17 00:00:00 2001 From: foxhui Date: Thu, 15 Jan 2026 03:31:33 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/admin/optimization.md | 10 ++++----- docs/config/overview.md | 41 +++++++++++++++++++++++++++++++++++ docs/en/admin/optimization.md | 10 ++++----- docs/en/config/overview.md | 41 +++++++++++++++++++++++++++++++++++ 4 files changed, 92 insertions(+), 10 deletions(-) diff --git a/docs/admin/optimization.md b/docs/admin/optimization.md index a807af1..894b891 100644 --- a/docs/admin/optimization.md +++ b/docs/admin/optimization.md @@ -46,8 +46,8 @@ 添加或修改以下内容: ```bash - # 使用 zstd 压缩算法,速度和压缩率最平衡 - ALGO=zstd + # 使用 lz4 压缩算法,速度和压缩率最平衡 + ALGO=lz4 # 使用内存总量的 60% 作为 ZRAM 大小 PERCENT=60 @@ -85,8 +85,8 @@ [zram0] # 使用内存总量的 60% zram-size = ram * 0.6 - # 使用 zstd 压缩算法 - compression-algorithm = zstd + # 使用 lz4 压缩算法 + compression-algorithm = lz4 # 优先级高于磁盘 Swap swap-priority = 100 ``` @@ -102,7 +102,7 @@ 无论使用哪种系统,都建议调整 `swappiness` 以更积极地使用 ZRAM。 ```bash -grep -q "vm.swappiness" /etc/sysctl.conf || echo "vm.swappiness=80" | tee -a /etc/sysctl.conf +grep -q "vm.swappiness" /etc/sysctl.conf || echo "vm.swappiness=20" | tee -a /etc/sysctl.conf sysctl -p ``` diff --git a/docs/config/overview.md b/docs/config/overview.md index f50b402..d13a367 100644 --- a/docs/config/overview.md +++ b/docs/config/overview.md @@ -57,6 +57,27 @@ browser: # ⚠️ 风险提示: 正常 Firefox 用户默认开启 Fission,虽然关闭它不会泄露常规指纹, # 但极高阶的反爬系统可能会通过检测“单进程模型”或“跨进程通信延迟”来识别自动化特征! fission: true + + # CSS 性能优化注入 + # 通过禁用网页特效在无显卡环境下降低 CPU 压力 + cssInject: + # 禁用网页动画 + # 作用:移除 transition 和 animation + # 收益:显著降低 CPU 持续占用 + # 风险:极低。几乎不影响浏览器指纹 + animation: false + + # 禁用滤镜和阴影 + # 作用:移除 blur(模糊)、box-shadow(阴影) 等复杂渲染 + # 收益:在无显卡环境下,能避免 CPU 占用 100% 导致卡顿 + # 风险:中。界面会变得难看,少数反爬可能会检测样式计算结果 + filter: false + + # 降低字体渲染质量 + # 作用:关闭字体抗锯齿,强制使用极速渲染模式 + # 收益:微量减少 CPU 绘图压力 + # ⚠️ 风险:高。会导致文字边缘有锯齿,且可能导致字体指纹与标准浏览器不符(易被高级反爬识别) + font: false # [全局代理] 如果 Instance 没有独立配置代理,将使用此配置 proxy: @@ -109,6 +130,26 @@ browser: | `headless` | boolean | `false` | 是否启用无头模式 | | `fission` | boolean | `true` | 是否启用站点隔离 (fission.autostart) | | `proxy` | object | - | 全局代理配置 | +| `cssInject` | object | - | CSS 性能优化注入配置 | + +#### CSS 优化注入 (cssInject) + +针对无显卡 (CPU-Only) 环境的性能优化选项。通过注入 CSS 禁用部分网页特效来降低 CPU 负载。 + +| 配置项 | 类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| `animation` | boolean | `false` | **禁用动画** (推荐)
作用:移除 transition 和 animation
收益:显著降低 CPU 持续占用
风险:极低 (几乎不影响指纹) | +| `filter` | boolean | `false` | **禁用特效**
作用:移除 blur、box-shadow 等
收益:避免复杂渲染导致的卡顿
风险:中 (界面美观度下降,极少反爬检测) | +| `font` | boolean | `false` | **极速字体**
作用:关闭字体抗锯齿
收益:微量减少绘图压力
风险:**高** (字体指纹异常,易被高级反爬识别) | + +### 后端资源池 (backend.pool) + +| 配置项 | 类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| `strategy` | string | `least_busy` | 负载均衡策略,可选:`least_busy` | +| `failover.enabled` | boolean | `true` | 是否启用故障自动转移 | +| `failover.maxRetries` | number | `2` | 故障转移最大重试次数 | +| `instances` | array | - | 浏览器实例列表,详见 [实例配置](/config/instances) | ### 适配器配置 (backend.adapter) diff --git a/docs/en/admin/optimization.md b/docs/en/admin/optimization.md index d3364e6..c47f550 100644 --- a/docs/en/admin/optimization.md +++ b/docs/en/admin/optimization.md @@ -50,8 +50,8 @@ This English version is translated by **Gemini 3 Flash**. Add or modify the following: ```bash - # Use zstd compression algorithm for the best balance of speed and ratio - ALGO=zstd + # Use lz4 compression algorithm for the best balance of speed and ratio + ALGO=lz4 # Use 60% of total memory as ZRAM size PERCENT=60 @@ -89,8 +89,8 @@ Recommended to use `zram-generator` for these systems. [zram0] # Use 60% of total memory zram-size = ram * 0.6 - # Use zstd compression algorithm - compression-algorithm = zstd + # Use lz4 compression algorithm + compression-algorithm = lz4 # Higher priority than disk Swap swap-priority = 100 ``` @@ -106,7 +106,7 @@ Recommended to use `zram-generator` for these systems. Regardless of the system, it is recommended to adjust `swappiness` to use ZRAM more aggressively. ```bash -grep -q "vm.swappiness" /etc/sysctl.conf || echo "vm.swappiness=80" | tee -a /etc/sysctl.conf +grep -q "vm.swappiness" /etc/sysctl.conf || echo "vm.swappiness=20" | tee -a /etc/sysctl.conf sysctl -p ``` diff --git a/docs/en/config/overview.md b/docs/en/config/overview.md index f711451..79a865e 100644 --- a/docs/en/config/overview.md +++ b/docs/en/config/overview.md @@ -61,6 +61,27 @@ browser: # ⚠️ Risk: Normal Firefox users have Fission enabled by default. While disabling it does not leak common fingerprints, # extremely advanced anti-bot systems might identify automated features via "single-process model" or "IPC delays". fission: true + + # CSS Performance Injection + # Reduce CPU load by disabling web effects (Best for CPU-only environments) + cssInject: + # Disable web animations + # Effect: Removes transition and animation + # Benefit: Significantly lowers continuous CPU usage + # Risk: Very low. Almost no impact on browser fingerprint + animation: false + + # Disable filters and shadows + # Effect: Removes blur, box-shadow, etc. + # Benefit: Prevents CPU spikes and lag in no-GPU environments + # Risk: Medium. Interface aesthetics degraded, few anti-bots might detect style calculations + filter: false + + # Reduce font rendering quality + # Effect: Disables font anti-aliasing, forces fast rendering mode + # Benefit: Slightly reduces CPU drawing pressure + # ⚠️ Risk: High. Jagged text edges; font fingerprint differs from standard browsers (detected by advanced anti-bots) + font: false # [Global Proxy] Used if an Instance does not have its own proxy configuration proxy: @@ -113,6 +134,26 @@ browser: | `headless` | boolean | `false` | Whether to enable headless mode. | | `fission` | boolean | `true` | Whether to enable Site Isolation (fission.autostart). | | `proxy` | object | - | Global proxy configuration. | +| `cssInject` | object | - | CSS performance injection configuration. | + +#### CSS Injection (cssInject) + +Performance optimization options for CPU-Only environments. Reduces CPU load by disabling specific web effects via CSS injection. + +| Item | Type | Default | Description | +| --- | --- | --- | --- | +| `animation` | boolean | `false` | **Disable Animations** (Recommended)
Effect: Removes transition and animation.
Benefit: Significantly reduces continuous CPU usage.
Risk: Very Low (Negligible impact on fingerprint). | +| `filter` | boolean | `false` | **Disable Effects**
Effect: Removes blur, box-shadow, etc.
Benefit: Prevents UI lag caused by complex rendering.
Risk: Medium (UI Aesthetics degraded, rarely checked by anti-bots). | +| `font` | boolean | `false` | **Fast Rendering Fonts**
Effect: Disables font anti-aliasing.
Benefit: Slightly reduces rendering pressure.
Risk: **High** (Font fingerprint anomaly, easily detected by advanced anti-bots). | + +### Backend Resource Pool (backend.pool) + +| Item | Type | Default | Description | +| --- | --- | --- | --- | +| `strategy` | string | `least_busy` | Load balancing strategy. Option: `least_busy`. | +| `failover.enabled` | boolean | `true` | Whether to enable automatic failover. | +| `failover.maxRetries` | number | `2` | Maximum retry attempts for failover. | +| `instances` | array | - | List of browser instances. See [Instances Configuration](/en/config/instances). | ### Adapter Configuration (backend.adapter)