<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[【实战】Cherry Studio + 自建 NewAPI 聚合网关多通道负载均衡与故障转移配置]]></title><description><![CDATA[<p dir="auto">最近把主力开发环境切换到了 Cherry Studio 客户端，后端配合轻量 Docker 自建的 NewAPI。</p>
<p dir="auto">分享一下核心配置思路：</p>
<ol>
<li>将 9AIB 上淘到的几家高性价比中转渠道按权重分组；</li>
<li>开启自动重试与渠道熔断策略（遇到 429 或 500 自动毫秒级切换下一渠道）；</li>
<li>本地客户端延迟直降至 600ms，成本节约 70%！</li>
</ol>
]]></description><link>https://9aib.com/community/topic/34/实战-cherry-studio-自建-newapi-聚合网关多通道负载均衡与故障转移配置</link><generator>RSS for Node</generator><lastBuildDate>Sat, 03 Oct 2026 20:43:27 GMT</lastBuildDate><atom:link href="https://9aib.com/community/topic/34.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 03 Oct 2026 18:21:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 【实战】Cherry Studio + 自建 NewAPI 聚合网关多通道负载均衡与故障转移配置 on Sat, 03 Oct 2026 19:52:07 GMT]]></title><description><![CDATA[<p dir="auto">强推这个方案！我也用的 Cherry Studio + NewAPI，补充一下我的 docker-compose 配置，亲测配合 9AIB 淘来的中转渠道非常稳：</p>
<pre><code class="language-yaml">version: '3.8'
services:
  new-api:
    image: calciumion/new-api:latest
    container_name: new-api
    restart: always
    ports:
      - "3000:3000"
    volumes:
      - ./data:/data
    environment:
      - SQL_DSN=root:123456@tcp(mysql:3306)/oneapi
      - TZ=Asia/Shanghai
</code></pre>
<blockquote>
<p dir="auto"><strong>防坑提示：</strong><br />
如果配置了多个中转商，建议开启 <strong>渠道测试（Channel Health Check）</strong>，把自动下线时间设为 30 秒，这样某家突然 502 时客户端完全无感，直接秒切备用通道。</p>
</blockquote>
<p dir="auto">附上实测压测指标对比：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="text-align:left">调度模式</th>
<th style="text-align:left">平均首字延迟 (TTFT)</th>
<th style="text-align:left">报错中断率</th>
<th style="text-align:left">月度综合成本</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><strong>单渠道直连</strong></td>
<td style="text-align:left">~1450ms</td>
<td style="text-align:left">4.8%</td>
<td style="text-align:left">¥120</td>
</tr>
<tr>
<td style="text-align:left"><strong>NewAPI 轮询网关</strong></td>
<td style="text-align:left"><strong>~420ms</strong></td>
<td style="text-align:left"><strong>&lt;0.1%</strong></td>
<td style="text-align:left"><strong>¥36</strong></td>
</tr>
</tbody>
</table>
<p dir="auto">大家可以参考折腾一下！</p>
]]></description><link>https://9aib.com/community/post/85</link><guid isPermaLink="true">https://9aib.com/community/post/85</guid><dc:creator><![CDATA[Cursor老玩家]]></dc:creator><pubDate>Sat, 03 Oct 2026 19:52:07 GMT</pubDate></item></channel></rss>