<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Ximou Zhao’s Blog</title>
        <link>https://ximouzhao.com/</link>
        <description>\(^o^)/~</description>
        <lastBuildDate>Thu, 20 Aug 2026 05:15:04 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en-US</language>
        <copyright>All rights reserved 2026, Ximou Zhao</copyright>
        <item>
            <title><![CDATA[内存触顶之后，Redis 会删谁的数据？]]></title>
            <link>https://ximouzhao.com/article/redis-maxmemory-eviction</link>
            <guid>https://ximouzhao.com/article/redis-maxmemory-eviction</guid>
            <pubDate>Sat, 15 Aug 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[一句话说清 maxmemory 触顶后谁有资格被删、副本为何默认不自己淘汰，以及淘汰解决不了单机容量上限。]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-3bc4b0ac588b814d8c54e8619ed37920"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-callout notion-blue_background_co notion-block-12b6eb6a01a4422ebe7cec372f52597a"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="🛒">🛒</span></div><div class="notion-callout-text"><div class="notion-text notion-block-0e705301934b43999472a15372a3d3f4">购物车、session 和商品缓存还在一台 Redis 上膨胀。监控开始报警：used_memory 逼近上限。本篇只回答：触顶后谁有资格被删、副本为何常常「看起来没在淘汰」，以及为什么淘汰解决不了单机容量上限。落盘见 <a class="notion-link" href="https://ximouzhao.com/article/redis-persistence-rdb-aof" target="_blank" rel="noopener noreferrer">持久化</a>，主从与自动切主见 <a class="notion-link" href="https://ximouzhao.com/article/redis-replication-sentinel" target="_blank" rel="noopener noreferrer">复制 / Sentinel</a>，装不下再水平切开见 <a class="notion-link" href="https://ximouzhao.com/article/redis-cluster-hash-slots" target="_blank" rel="noopener noreferrer">Cluster 哈希槽</a>。整张地图见<a class="notion-link" href="https://ximouzhao.com/article/redis-standalone-to-cluster" target="_blank" rel="noopener noreferrer">从单机到分片</a>。缓存穿透 / 击穿 / 雪崩与 Cache-Aside 不在本篇范围。</div></div></div><div class="notion-text notion-block-ab5a8d1661224f74b6cb986286906a3d">系列压力阶梯（全系列同一张图；本篇钉住「淘汰(A4)」）。整图说明见<a class="notion-link" href="https://ximouzhao.com/article/redis-standalone-to-cluster" target="_blank" rel="noopener noreferrer">从单机到分片</a>。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-b23ad2a2fcbc42f29c8ae7c521d678a5" data-id="b23ad2a2fcbc42f29c8ae7c521d678a5"><span><div id="b23ad2a2fcbc42f29c8ae7c521d678a5" class="notion-header-anchor"></div><a class="notion-hash-link" href="#b23ad2a2fcbc42f29c8ae7c521d678a5" title="内存报警时，是 OOM 崩掉还是开始丢 key？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">内存报警时，是 OOM 崩掉还是开始丢 key？</span></span></h3><div class="notion-text notion-block-fde2a5810553458087e967df6b4d6b84">App 持续 <code class="notion-inline-code">SET</code> / <code class="notion-inline-code">HSET</code>，Redis 进程的已用内存往上爬。你配置了 <code class="notion-inline-code">maxmemory</code>（服务端允许数据占用的内存上限）之后，触顶时会发生什么，并不取决于「机器还剩多少物理 RAM」，而取决于 <code class="notion-inline-code">maxmemory-policy</code>（触顶后的内存淘汰策略）。</div><div class="notion-text notion-block-f85f042db9d647fb84b0e75b28331cbc">两条分叉很清楚：</div><ol start="1" class="notion-list notion-list-numbered notion-block-3727265047864558a050d722533efc76" style="list-style-type:decimal"><li><b>拒写</b>：策略是 <code class="notion-inline-code">noeviction</code>（或不淘汰候选集为空）时，新的写命令失败，已有 key 尽量留下。</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-d12ecc43448a4f89a9c2e12f39cfe359" style="list-style-type:decimal"><li><b>删 key</b>：策略允许淘汰时，Redis 按规则挑出受害者删掉，腾出空间后再接受写。</li></ol><div class="notion-text notion-block-90e84f24dd00444abd5ef52fc2302a44">还有一个运维边界：复制积压、持久化等<b>缓冲区占用不计入</b>与 <code class="notion-inline-code">maxmemory</code> 的比较。因此上限要留余量——把 <code class="notion-inline-code">maxmemory</code> 顶满整机可用内存，仍可能被缓冲区推到真实 OOM。</div><blockquote class="notion-quote notion-block-b08e69f5d1594b5ca018f04442d613ec"><div>触顶不是「机器必崩」，而是「按你设的策略：拒写，或删谁」。</div></blockquote><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-92ad0bd513c3465887cec32b527352ed" data-id="92ad0bd513c3465887cec32b527352ed"><span><div id="92ad0bd513c3465887cec32b527352ed" class="notion-header-anchor"></div><a class="notion-hash-link" href="#92ad0bd513c3465887cec32b527352ed" title="allkeys 和 volatile 差在「谁有资格被删」"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">allkeys 和 volatile 差在「谁有资格被删」</span></span></h3><table class="notion-simple-table notion-block-8911fcf6063c4219823ba145b611b7bc"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-54f9cb6b9b5b448384b78fc691f751cb"><td class="" style="width:120px"><div class="notion-simple-table-cell">policy</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">谁有资格被删</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">触顶行为</div></td></tr><tr class="notion-simple-table-row notion-block-e3d0157ee6ee4c6b8f58aac3f4a6340d"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">noeviction</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">无人</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">拒写；不主动删 key</div></td></tr><tr class="notion-simple-table-row notion-block-84a0837a9c954e23899e222b32483585"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">allkeys-lru</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">全部 key</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">近似 LRU：优先删「最久没被访问」的</div></td></tr><tr class="notion-simple-table-row notion-block-70ec9f63fa9642d1b8e2f70901f54852"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">allkeys-lfu</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">全部 key</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">LFU：优先删「访问最不频繁」的</div></td></tr><tr class="notion-simple-table-row notion-block-5b668a1a83b94c06a2a85d2900f1fc52"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">allkeys-random</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">全部 key</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">在全部 key 里随机删</div></td></tr><tr class="notion-simple-table-row notion-block-8ef3cd83bd49490f9fd16dd377f73a7e"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">volatile-lru</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">仅带 expire 的 key</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">在带过期时间的集合里做近似 LRU</div></td></tr><tr class="notion-simple-table-row notion-block-3f3b73121cdb4583adf2d587c6051065"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">volatile-lfu</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">仅带 expire 的 key</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">在带过期时间的集合里做 LFU</div></td></tr><tr class="notion-simple-table-row notion-block-8fe5c6d3a41649ad9d36af3d681ee0fa"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">volatile-random</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">仅带 expire 的 key</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">在带过期时间的集合里随机删</div></td></tr><tr class="notion-simple-table-row notion-block-1c4f5c1f45ef4e268cbe565da1124d4f"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">volatile-ttl</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">仅带 expire 的 key</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">优先删「更接近过期」的</div></td></tr></tbody></table><div class="notion-text notion-block-eb61906580c64a0f9fff5170e5f6e59f">本地定义两句就够用：</div><ul class="notion-list notion-list-disc notion-block-771ba1e452864c4c91fa0d8bb7b20f15"><li>allkeys 系策略：候选集是整库 key；购物车、无 TTL 的 session、商品缓存都可能被删。</li></ul><ul class="notion-list notion-list-disc notion-block-a31c09fc67da44ba8eea2c269deeaf12"><li>volatile 系策略：候选集只含设置了过期时间（expire）的 key。若库里没有任何带 expire 的 key，<code class="notion-inline-code">volatile-*</code> 的行为会接近 <code class="notion-inline-code">noeviction</code>——你以为会淘汰，实际却在拒写。</li></ul><div class="notion-text notion-block-36a8a6e7b9e24c1094eb962b1c9e9ff9">近似 LRU（Least Recently Used，最近最少使用）不会扫全库，而是用采样（<code class="notion-inline-code">maxmemory-samples</code>）估「谁更冷」。LFU（Least Frequently Used，最不经常使用）从 Redis 4.0 起可用，可用 <code class="notion-inline-code">lfu-log-factor</code> / <code class="notion-inline-code">lfu-decay-time</code> 调「多热才算热」。官方把 <code class="notion-inline-code">allkeys-lru</code> 当作多数「访问服从帕累托分布」缓存场景的合理默认：少数热 key 留下，长尾冷 key 先让路。</div><details class="notion-toggle notion-block-524761b0e5184345930ebae2e5cc5922"><summary>Redis 8.6+ 的 LRM，以及怎么用命中率调策略？（非主结论）</summary><div><div class="notion-text notion-block-ea6a04570e0b4dcbb6633c50e4f8d03c">从 Redis <b>8.6</b> 起还有 <code class="notion-inline-code">allkeys-lrm</code> / <code class="notion-inline-code">volatile-lrm</code>（Least Recently Modified，按写侧时间戳偏向更久未改的 key）。版本不够就不要当通用建议。调策略时看 <code class="notion-inline-code">INFO</code> 的 <code class="notion-inline-code">keyspace_hits</code> / <code class="notion-inline-code">keyspace_misses</code> 与 <code class="notion-inline-code">evicted_keys</code>：命中率差、淘汰猛，说明候选集或算法与访问形态不匹配。也可用 <code class="notion-inline-code">redis-cli --hotkeys</code> 抽样看热点（本身不是容量扩容方案）。</div></div></details><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-0a38944ced854b53be11c3c3ef71a5b8" data-id="0a38944ced854b53be11c3c3ef71a5b8"><span><div id="0a38944ced854b53be11c3c3ef71a5b8" class="notion-header-anchor"></div><a class="notion-hash-link" href="#0a38944ced854b53be11c3c3ef71a5b8" title="副本为什么常常「看起来没在淘汰」？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">副本为什么常常「看起来没在淘汰」？</span></span></h3><div class="notion-text notion-block-4fcd5353278c4094a0c67021d8ca9a1f">你在 master 上看到 <code class="notion-inline-code">evicted_keys</code> 在涨，副本上却「安静」——这往往不是监控坏了。</div><div class="notion-callout notion-yellow_background_co notion-block-3d730a208bda4cc7aaf3c93051dece19"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="⚠️">⚠️</span></div><div class="notion-callout-text"><div class="notion-text notion-block-f9ba5a2af5c642f28bd23464acb3f9f4">默认情况下，副本会忽略自己的 <code class="notion-inline-code">maxmemory</code>，不在本地独立跑淘汰。主节点按策略删 key 后，会把合成的 <code class="notion-inline-code">DEL</code> 复制给副本，副本跟着删。若把 <code class="notion-inline-code">replica-ignore-maxmemory</code> 设为 <code class="notion-inline-code">no</code>，副本才会按自己的 <code class="notion-inline-code">maxmemory</code> 参与淘汰——这通常只适合可写副本或你明确接受主从可能短暂不一致、且写入幂等的场景，改之前要搞清楚后果。即便配置了 <code class="notion-inline-code">maxmemory</code>，副本仍可能用掉比该上限更多的内存——要盯副本真实占用，避免物理机 OOM，而不能只看「策略名」。</div></div></div><div class="notion-text notion-block-73a11d005e214e2ead00f62ab23b4568">因果链是：App 写 master → master 触顶并淘汰 → 复制流带上删除 → 副本数据集跟随。副本自己不「另起一套 LRU」，所以仪表盘上常常「主在淘汰、从在跟」。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-b7e7bb6c5b6c469394c2b1d70eddc926" data-id="b7e7bb6c5b6c469394c2b1d70eddc926"><span><div id="b7e7bb6c5b6c469394c2b1d70eddc926" class="notion-header-anchor"></div><a class="notion-hash-link" href="#b7e7bb6c5b6c469394c2b1d70eddc926" title="淘汰解决不了单机容量上限"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">淘汰解决不了单机容量上限</span></span></h3><div class="notion-text notion-block-06fff5f0026a40ce84a8c498eecc68a6">淘汰回答的是：<b>这一台</b>内存顶满时，拒写还是丢谁。它不把键空间摊到多机，也不提高「整库还能装多少不相关的热数据」。</div><div class="notion-text notion-block-ecd9b06cd8cc4d34826134c856a11825">若工作集已经稳定大于单机可承载（扣掉缓冲区余量之后），换 <code class="notion-inline-code">allkeys-lru</code> 只会更频繁地删仍可能被访问的 key，换来更高的后端穿透与抖动——工作集并没有变小。要水平切开键空间，走到 <a class="notion-link" href="https://ximouzhao.com/article/redis-cluster-hash-slots" target="_blank" rel="noopener noreferrer">Cluster 的 16384 哈希槽</a>，而不是继续在单进程里赌淘汰算法。</div><blockquote class="notion-quote notion-block-efe1b79ed92742f6b76e4cbf529905b2"><div>淘汰是单机泄压阀；分片才是容量扩容。</div></blockquote><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-7e0b389b7589462facaa60ebb3cba84d" data-id="7e0b389b7589462facaa60ebb3cba84d"><span><div id="7e0b389b7589462facaa60ebb3cba84d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#7e0b389b7589462facaa60ebb3cba84d" title="清单：触顶前确认的配置"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">清单：触顶前确认的配置</span></span></h3><div class="notion-text notion-block-621c0170227f406290f971b995f708be">因果收束：App 写入撑大内存 → 碰到 <code class="notion-inline-code">maxmemory</code> → <code class="notion-inline-code">maxmemory-policy</code> 决定拒写或在「全库 / 仅带 TTL」候选集里删 key → 默认由 master 淘汰并复制 <code class="notion-inline-code">DEL</code>，副本不独自淘汰且可能超过 <code class="notion-inline-code">maxmemory</code> → 淘汰管不了「数据集已经装不进一台」——那是分片问题。</div><div class="notion-text notion-block-e2b2a7bdb5bc49b387093ce06610381a">上线前自检：</div><div class="notion-to-do notion-block-0872973ab5b94c1089e4041e16ea309b"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">已设置 <code class="notion-inline-code">maxmemory</code>，并为复制 / 持久化等缓冲区留出主机余量</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-e72406cc52bd4ddba1909261517c04fb"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body"><code class="notion-inline-code">maxmemory-policy</code> 与业务一致：缓存可丢用 allkeys；必须保住无 TTL 键时慎用 volatile 或改用拒写</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-a7d823428ca1475dafce90708c178536"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">若选 <code class="notion-inline-code">volatile-*</code>，确认关键键确实带 expire；否则行为接近 <code class="notion-inline-code">noeviction</code></div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-fb8b75a84fff4588bf26ab0703890942"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">监控 <code class="notion-inline-code">used_memory</code>、<code class="notion-inline-code">evicted_keys</code>、<code class="notion-inline-code">keyspace_hits</code> / <code class="notion-inline-code">keyspace_misses</code>，以及<b>副本</b>真实内存，防物理 OOM</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-be7766d4363e4ecba90edb16f7aee52e"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">默认副本忽略 <code class="notion-inline-code">maxmemory</code> 已理解；仅在明确需要时改 <code class="notion-inline-code">replica-ignore-maxmemory</code></div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-8c0b029d48604a269677a69f27fd5423"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">工作集长期大于单机上限时，转向分片（见 Cluster 篇），而不是只换淘汰策略</div></div><div class="notion-to-do-children"></div></div><details class="notion-toggle notion-block-c2672521f1d244de8774aae4a64910d2"><summary>Sources</summary><div><ul class="notion-list notion-list-disc notion-block-1e34dedc91a345d88bbeaed0ec82ce13"><li>Evidence rechecked: 2026-08-15</li></ul><ul class="notion-list notion-list-disc notion-block-6b671917af8d4d7599c6a38b2bbfda98"><li><a class="notion-link" href="https://redis.io/docs/latest/develop/reference/eviction/" target="_blank" rel="noopener noreferrer">Key eviction</a> — <code class="notion-inline-code">maxmemory</code> / <code class="notion-inline-code">maxmemory-policy</code>；<code class="notion-inline-code">volatile-*</code> 在无 expire key 时接近 <code class="notion-inline-code">noeviction</code>；<code class="notion-inline-code">allkeys-lru</code> 与帕累托场景；缓冲区不计入 maxmemory 比较并需留 RAM；近似 LRU 与 <code class="notion-inline-code">maxmemory-samples</code>；LFU（≥4.0）与 <code class="notion-inline-code">lfu-log-factor</code> / <code class="notion-inline-code">lfu-decay-time</code>；LRM（≥8.6，仅扩展阅读）；<code class="notion-inline-code">INFO</code> 的 hits/misses / <code class="notion-inline-code">evicted_keys</code></li></ul><ul class="notion-list notion-list-disc notion-block-275962029c444223aa3716d0258d74ba"><li><a class="notion-link" href="https://redis.io/docs/latest/operate/oss_and_stack/management/replication/" target="_blank" rel="noopener noreferrer">Replication — Maxmemory on replicas</a> — 副本默认忽略 <code class="notion-inline-code">maxmemory</code>；主淘汰并复制 <code class="notion-inline-code">DEL</code>；<code class="notion-inline-code">replica-ignore-maxmemory no</code>；副本可能使用超过 <code class="notion-inline-code">maxmemory</code> 的内存</li></ul><ul class="notion-list notion-list-disc notion-block-e3db1bf5d0be43879a83a4f7dc824d65"><li>系列相关：<a class="notion-link" href="https://ximouzhao.com/article/redis-persistence-rdb-aof" target="_blank" rel="noopener noreferrer">持久化</a> · <a class="notion-link" href="https://ximouzhao.com/article/redis-replication-sentinel" target="_blank" rel="noopener noreferrer">复制 / Sentinel</a> · <a class="notion-link" href="https://ximouzhao.com/article/redis-cluster-hash-slots" target="_blank" rel="noopener noreferrer">Cluster 哈希槽</a></li></ul></div></details></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[进程被 kill 之后，Redis 里还剩什么？]]></title>
            <link>https://ximouzhao.com/article/redis-persistence-rdb-aof</link>
            <guid>https://ximouzhao.com/article/redis-persistence-rdb-aof</guid>
            <pubDate>Fri, 14 Aug 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[用重启事故讲清 RDB、AOF 与 appendfsync 各自承诺的丢失窗口，以及混合持久化怎么选。]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-3bc4b0ac588b81ebae86c25e76a6b579"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-callout notion-blue_background_co notion-block-9e797e54ae3d4b95b4f9eb43a28486c9"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="🛒">🛒</span></div><div class="notion-callout-text"><div class="notion-text notion-block-e7a8516ba54f45298b1746b7e632e93e">单机 Redis 扛着购物车、登录 session 和商品缓存。运维重启机器，或进程被 kill 之后，有人发现购物车「没了」，有人发现「差点没了」。本文只回答一件事：进程没了之后，磁盘上还能剩什么、丢多少取决于什么配置。缓存怎么写穿、穿透击穿雪崩是另一类问题——同站另有一篇讲缓存策略的文章；这里不重复那一套。整张压力地图见<a class="notion-link" href="https://ximouzhao.com/article/redis-standalone-to-cluster" target="_blank" rel="noopener noreferrer">从单机到分片</a>。</div></div></div><div class="notion-text notion-block-a2917a519f574bdfb9ee1ead1b7fe0ae">系列压力阶梯（全系列同一张图；本篇钉住「落盘(A1)」）。整图说明见<a class="notion-link" href="https://ximouzhao.com/article/redis-standalone-to-cluster" target="_blank" rel="noopener noreferrer">从单机到分片</a>。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-090ad832aa784d1ab822e3d672ae2b4c" data-id="090ad832aa784d1ab822e3d672ae2b4c"><span><div id="090ad832aa784d1ab822e3d672ae2b4c" class="notion-header-anchor"></div><a class="notion-hash-link" href="#090ad832aa784d1ab822e3d672ae2b4c" title="重启之后，购物车为什么「没了」？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">重启之后，购物车为什么「没了」？</span></span></h3><div class="notion-text notion-block-86fee223ed9747eeb03db2868219f5a7">事故现场通常很像这样：App 一直在写 Redis，监控里命令都成功了；进程一没，再连上来，键空间却空了一截，甚至整库空了。</div><div class="notion-text notion-block-7268df26b0dd404c962be18a8507d0fa">先分清三个角色，后面整篇文章都围着它们转：</div><ul class="notion-list notion-list-disc notion-block-22a979a7953d4fc383305e76f77e07d4"><li><b>你 / App</b>：发出 <code class="notion-inline-code">SET</code>、<code class="notion-inline-code">HSET</code> 等写命令，等 Redis 回成功。</li></ul><ul class="notion-list notion-list-disc notion-block-662669234e154efa93cad34e14318bda"><li><b>Redis 进程内存</b>：真正对外服务的那份数据；进程没了，这份就没了。</li></ul><ul class="notion-list notion-list-disc notion-block-60d6c5a1845c4fce89f81031284b65b4"><li><b>磁盘上的持久化文件</b>：可选的 RDB / AOF；只有它们在，重启才有机会「把库装回来」。</li></ul><div class="notion-text notion-block-4440391b753a47ec9c1565ac65cda0f9">「写成功了」往往只表示：<b>内存里已经改完，并且客户端拿到了应答</b>。它<b>不等于</b>「磁盘上已经安全留下了同一笔写」。若当时没开持久化，或持久化的丢失窗口刚好盖住了事故时段，你就会看到购物车「没了」或「差点没了」。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-902f9e50d0864132bcf96badd0edbaab" data-id="902f9e50d0864132bcf96badd0edbaab"><span><div id="902f9e50d0864132bcf96badd0edbaab" class="notion-header-anchor"></div><a class="notion-hash-link" href="#902f9e50d0864132bcf96badd0edbaab" title="数据先在内存里，落盘是第二件事"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">数据先在内存里，落盘是第二件事</span></span></h3><div class="notion-text notion-block-86f449efd5c84cd6a5c01dabf56aca2a">Redis 默认是内存数据库：读、写、过期、淘汰都先在内存里完成。持久化（Persistence，把内存状态落到磁盘以便崩溃后恢复）是可选能力，不是「每条写命令自动双写到盘」的隐含承诺。</div><div class="notion-text notion-block-47d2732e6f2644efad1281bbb19616dd">官方可选组合很直接：只开 <b>RDB</b>、只开 <b>AOF</b>、都不开，或 <b>RDB + AOF</b> 一起开。都不开时，进程被 kill 或机器重启后，内存数据就没了——磁盘上没有可加载的恢复源。</div><div class="notion-text notion-block-f18075f794bc44bb9daa9f7172d3f9f1">一次普通写入的因果链是：</div><div class="notion-text notion-block-2597f35f1cce4549a2d3f2e677ed8fa2">读这张图时抓住一点：<b>ACK 发生在内存侧</b>。磁盘侧是否跟上、跟上多少，由你有没有开持久化、以及 appendfsync / 快照节奏决定。持久化<b>不</b>把 Redis 变成「每次写都强同步到盘才回包」的引擎——除非你显式选了最严的 AOF 刷盘策略，且仍要接受性能代价。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-72a4cd7e0ee94bf68b8e7e7ef4202da9" data-id="72a4cd7e0ee94bf68b8e7e7ef4202da9"><span><div id="72a4cd7e0ee94bf68b8e7e7ef4202da9" class="notion-header-anchor"></div><a class="notion-hash-link" href="#72a4cd7e0ee94bf68b8e7e7ef4202da9" title="RDB 快照能救什么、救不了什么？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">RDB 快照能救什么、救不了什么？</span></span></h3><div class="notion-text notion-block-cfe388feaeac4765b0ce7af74b3c7f05"><b>RDB（Redis Database，点时间快照）</b> 是把某一时刻的内存数据集写成一个紧凑的二进制文件。它适合备份、适合较快地从快照恢复；官方也强调它用 fork() 拉起子进程去做落盘，父进程继续对外服务。</div><div class="notion-text notion-block-a2e2e80338724a889da84e849f235f82">它能救的是：<b>最后一次成功快照那一刻</b>的全库样子。进程被 kill 后，若磁盘上还有这份文件，重启可以把库装回快照点。</div><div class="notion-text notion-block-1ae4139f5ec84bca9637861e1a2ad6d6">它救不了的是：<b>两次成功快照之间</b>发生的全部写入。若你依赖「每隔一段时间存一次」，崩溃刚好落在两次保存中间，那几分钟（或你配置的间隔）里的购物车变更就会丢。RDB <b>不</b>承诺「刚 ACK 的那一笔一定进盘」；它只承诺「有一份可用的历史切片」。</div><div class="notion-text notion-block-62e5296130ab499d961b5145b5e72f6f">另外，fork() 会带来短暂的资源压力（父子共享页、写时复制），高写入负载下可能抖一下——这是机制成本，不是「开了 RDB 就零代价」。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-f034e1aa69c74173baa7d7c2412f97ee" data-id="f034e1aa69c74173baa7d7c2412f97ee"><span><div id="f034e1aa69c74173baa7d7c2412f97ee" class="notion-header-anchor"></div><a class="notion-hash-link" href="#f034e1aa69c74173baa7d7c2412f97ee" title="AOF 是在记「做过的写」，还是保证「永不丢」？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">AOF 是在记「做过的写」，还是保证「永不丢」？</span></span></h3><div class="notion-text notion-block-4812aa36851f4deb859d080355c8bd4b"><b>AOF（Append Only File，仅追加文件）</b> 把写命令追加进日志；恢复时重放这些命令，重建数据集。AOF 还会做 rewrite（重写）：在合适时机生成一份更短、但仍等价的命令集，避免日志无限膨胀。</div><div class="notion-text notion-block-a818199fd970420295277f882dadb1c7">AOF 记的是「做过的写」，不是口头上的「永不丢」。真正决定丢失窗口的，是配置项 appendfsync（把 AOF 刷到磁盘的策略）：</div><table class="notion-simple-table notion-block-9ca58867c6ec4bcbad5934236c20249d"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-6cc31ad0a1a94c99b7c8c286da0d605b"><td class="" style="width:120px"><div class="notion-simple-table-cell">appendfsync</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">大致做什么</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">崩溃时可能丢什么</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">代价直觉</div></td></tr><tr class="notion-simple-table-row notion-block-3b3fd41478b548f1b00ac6e9506d3de8"><td class="" style="width:120px"><div class="notion-simple-table-cell">always</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">每条写都 fsync</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">官方称最安全；仍受盘/系统故障边界约束</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">最慢</div></td></tr><tr class="notion-simple-table-row notion-block-837395de6da648d9a374163744d61f99"><td class="" style="width:120px"><div class="notion-simple-table-cell">everysec</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">大约每秒 fsync</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">官方说明：可能丢掉约 1 秒的数据</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">常用折中</div></td></tr><tr class="notion-simple-table-row notion-block-e19f2e013319419ba86c1acb92280959"><td class="" style="width:120px"><div class="notion-simple-table-cell">no</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">交给操作系统决定何时刷盘</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">窗口依赖内核与负载；勿写成「固定总是 N 秒」</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">通常更快、更不可控</div></td></tr></tbody></table><div class="notion-text notion-block-7f7e760c475d4fe7abc0c45715e27eff">所以：AOF <b>缩小</b>了相对纯 RDB 间隔的丢失窗口，尤其是 everysec / always；它<b>不</b>等于分布式强一致，也<b>不</b>等于「App 收到 ACK 后，副本 / 别的机器上也一定有这份写」（那是复制话题）。</div><details class="notion-toggle notion-block-9798291dfa8a41a9b3613b8a3161fb0d"><summary>appendfsync no 为什么不能写死「Linux 总是 30 秒」？</summary><div><div class="notion-text notion-block-a368d20d71a54e20b8fae1d1ca09cee1">官方文档会提到：在 appendfsync no 时，刷盘时机由操作系统决定，并举例 Linux 上常见量级可能到约 30 秒量级。那是说明「窗口可以很大、且不由 Redis 精确保证」，不是给你一张「永远 30 秒」的 SLA。选型时请写成：依赖 OS / 内核刷新行为，丢失窗口不可用固定秒数硬编码进事故预案。</div></div></details><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-cb2728d1a3e24427849365ae3e95acc0" data-id="cb2728d1a3e24427849365ae3e95acc0"><span><div id="cb2728d1a3e24427849365ae3e95acc0" class="notion-header-anchor"></div><a class="notion-hash-link" href="#cb2728d1a3e24427849365ae3e95acc0" title="为什么常建议 RDB+AOF 一起开？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">为什么常建议 RDB+AOF 一起开？</span></span></h3><div class="notion-text notion-block-5e5b2b2f2643490f9adc60c61b695fcb">当 <b>RDB 与 AOF 同时启用</b> 时，官方重启加载规则是：优先用 <b>AOF</b>，因为它通常更完整（覆盖到更近的写入）。决策可以画成：</div><div class="notion-text notion-block-3b33b5c1a04f46ae87815286219e04a1">耐久性真的重要时，官方更倾向 <b>两者一起开</b>：AOF 负责更细的恢复粒度，RDB 仍适合备份与某些重启/运维路径。文档也会提醒：在部分备份与重启相关考量上，不宜把「只开 AOF」当成唯一习惯——具体取舍以当前版本文档为准，但主结论可以收成一句：<b>要尽量剩数据，优先 RDB+AOF，而不是赌单一机制</b>。</div><div class="notion-text notion-block-8dc68662107a4637b1f5f646ef969e4d">双开<b>不</b>消灭丢失窗口：AOF 仍受 appendfsync 约束；RDB 仍只保证快照点。它改善的是「恢复用哪份更完整、备份与日常落盘怎么分工」，不是「从此零丢失」。</div><div class="notion-callout notion-orange_background_co notion-block-78bdea40f03840e68c1bb15fdabbbfaa"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="⚠️">⚠️</span></div><div class="notion-callout-text"><div class="notion-text notion-block-31d0ca3dc263491cbe26e876837bd279">还有一个比「本机丢几秒」更狠的坑：若 <b>master 没开持久化</b>，又被自动拉起成空实例，副本可能跟着同步这份「空主」，把原来还在的数据冲掉。单机持久化解决不了复制拓扑里的这个问题；系列下一篇会专门讲复制与 Sentinel。现在只要记住：无持久化 + 自动重启，危险面比「本机购物车丢了」更大。</div></div></div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-7c12f2d64d9a491f85553c4030f542a2" data-id="7c12f2d64d9a491f85553c4030f542a2"><span><div id="7c12f2d64d9a491f85553c4030f542a2" class="notion-header-anchor"></div><a class="notion-hash-link" href="#7c12f2d64d9a491f85553c4030f542a2" title="Redis 7 之后 AOF 文件长什么样？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">Redis 7 之后 AOF 文件长什么样？</span></span></h3><div class="notion-text notion-block-8e93f22dc3044e96bf07edc23a36a2cc">若你的 Redis <b>≥ 7.0</b>，AOF 不再只是「一个越写越长的 append 文件」这一种心智：官方采用 <b>multi-part AOF（多文件 AOF）</b>——通常包括 base、增量（incremental）以及 <b>manifest（清单）</b> 来描述如何组装恢复。运维时要按版本文档看待目录与文件集合，而不是只盯一个 <code class="notion-inline-code">.aof</code> 文件名。</div><details class="notion-toggle notion-block-bf6f74fea76e418e94c292ac1d209751"><summary>多文件 AOF 对你运维意味着什么？</summary><div><div class="notion-text notion-block-7f621f4be6ef4d62afcf8d7102a9e7f5">恢复时 Redis 按 manifest 把 base 与增量部分拼成完整重放输入。备份、拷贝实例目录、做磁盘容量规划时，要按「一组相关文件」处理，避免只复制了其中一部分却以为「AOF 齐了」。版本低于 7 时，不要把「multipart」当成你环境里的默认事实；升级前后对照官方 Persistence 文档。</div></div></details><details class="notion-toggle notion-block-76dd01d4c01d401ebaeb0fd86f0e747e"><summary>（非通用）Redis ≥ 8.10 的 BACKUP 命令族</summary><div><div class="notion-text notion-block-d8ad9303b30a410dbe1e71c27d7e66fb">官方 Persistence 文档提到 <b>BACKUP</b> 相关能力出现在较新版本（≥ 8.10.0）。它不是「所有线上 Redis 都已具备」的默认工具，也<b>不应</b>写进「你今天必须怎么选 RDB/AOF」的主结论。若你的版本够新，再单独对照该版本文档评估是否纳入备份流程。</div></div></details><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-0953fca4d44943849822ce84fc508046" data-id="0953fca4d44943849822ce84fc508046"><span><div id="0953fca4d44943849822ce84fc508046" class="notion-header-anchor"></div><a class="notion-hash-link" href="#0953fca4d44943849822ce84fc508046" title="你该怎么选：缓存可丢 vs 必须尽量剩"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">你该怎么选：缓存可丢 vs 必须尽量剩</span></span></h3><div class="notion-text notion-block-cb128d75dd104693b4ea351b44596325">回到购物车场景：先问数据<b>丢了能不能从别处重建</b>，再选持久化强度。</div><div class="notion-to-do notion-block-6197c4bb53364b4682cffdd8d704e1c9"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body"><b>商品缓存、可回源的读模型</b>：丢了能打回数据库重建 → 可以接受较弱持久化，甚至（在充分理解风险后）不为「缓存层」追求最强耐久；但仍要警惕上一节的「空主拖死副本」。</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-e48f37d7d5394cbca4ee1d35a283cb8c"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body"><b>购物车 / session 等不好立刻重建、丢了直接伤体验或登录态</b>：至少认真评估 <b>AOF</b>，常用折中是 appendfsync everysec（官方：可能丢约 1 秒）；更不能丢再评估 always 与性能。</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-3e83476e69d24927a69628a089a0c67a"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body"><b>耐久性重要</b>：优先 <b>RDB + AOF</b>；重启时按官方规则偏向加载更完整的 AOF，RDB 继续承担备份/运维角色。</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-c97cadfcd4154e56b25003ecd09674cd"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body"><b>只开 RDB</b>：接受「两次快照之间的写入可能整段丢」；适合你明确只要点时间备份、能容忍分钟级窗口的场景。</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-05a18d71630140e3beeabd9877e961eb"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body"><b>只开 AOF</b>：可以，但请对照官方关于备份与重启的建议，不要把它当成「已经覆盖 RDB 全部用途」的自动结论。</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-5ab6319f18194ef582a1aef97c8ca1df"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body"><b>版本门控</b>：≥7 按 multi-part AOF 运维目录与文件集合（具体见上一节 Toggle）。</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-b1993bb54f0d4d2c8a17df6a5b94f9bc"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body"><b>范围外</b>：托管云厂商控制台专有行为、本机「感觉很快所以一定没丢」——都不能替代上述配置事实。</div></div><div class="notion-to-do-children"></div></div><blockquote class="notion-quote notion-block-50a709a658c844a7aa16888279d8f472"><div>进程 ACK 的是内存；磁盘承诺的是你配置的丢失窗口。</div></blockquote><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-b482e9a99b6d4bccb1f92634ce038d3f" data-id="b482e9a99b6d4bccb1f92634ce038d3f"><span><div id="b482e9a99b6d4bccb1f92634ce038d3f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#b482e9a99b6d4bccb1f92634ce038d3f" title="一句话收束"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">一句话收束</span></span></h3><div class="notion-text notion-block-0f2d493791a94b21962b910d3ff4c24e">你写入 → Redis <b>内存</b>先改并应答 →（可选）<b>RDB</b> 留下点时间切片、<b>AOF</b> 按 appendfsync 追加写日志 → 进程被 kill 后，能恢复的只有磁盘上那份，且窗口由快照间隔与刷盘策略决定 → 双开时重启更偏 AOF；无持久化的自动拉起还可能在复制场景里放大成空主事故。缓存策略（怎么跟数据库配合）是另一篇文章的问题；本文只钉死「崩溃后磁盘上还剩什么」。</div><details class="notion-toggle notion-block-cb277f1b135345948b9538212764072a"><summary>来源与更深阅读</summary><div><div class="notion-text notion-block-4c3c67f0b17a4b349f5c31933426d2c1">证据复核日期：2026-08-14。</div><div class="notion-text notion-block-f8cabd2f41bc424aa79a1a61733e03f2">主文档（持久化选项、RDB、AOF、appendfsync、双开加载偏好、≥7 multi-part AOF、BACKUP 版本门控）：<a class="notion-link" href="https://redis.io/docs/latest/operate/oss_and_stack/management/persistence/" target="_blank" rel="noopener noreferrer">https://redis.io/docs/latest/operate/oss_and_stack/management/persistence/</a></div><div class="notion-text notion-block-6f642863a81047c29178de147f587fe9">复制文档（无持久化 master 自动重启可能清空已同步副本的警告）：<a class="notion-link" href="https://redis.io/docs/latest/operate/oss_and_stack/management/replication/" target="_blank" rel="noopener noreferrer">https://redis.io/docs/latest/operate/oss_and_stack/management/replication/</a></div><div class="notion-text notion-block-45b120b5265e4f36beda0093a7735623">系列下一篇将展开：异步复制、丢失窗口与 Sentinel 自动切换——与本文的「本机磁盘还剩什么」衔接，但不替代持久化选型。</div></div></details></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Redis 扩容靠的不是一致性哈希：16384 个槽如何托住水平扩展？]]></title>
            <link>https://ximouzhao.com/article/redis-cluster-hash-slots</link>
            <guid>https://ximouzhao.com/article/redis-cluster-hash-slots</guid>
            <pubDate>Sat, 15 Aug 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[纠正「Redis=一致性哈希」的常见误解，讲清 16384 哈希槽、hash tag、MOVED/ASK 与常见 3+3 部署边界。]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-3bc4b0ac588b81a28c3fcd405dcc9a3d"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-callout notion-blue_background_co notion-block-fbc54ae4354848e48b5bcb8f8de622c4"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text"><div class="notion-text notion-block-65887a4330ec4becb10961f11a4aaf2a">购物车与商品缓存已经塞满一台 Redis。你会立刻想到「上一致性哈希（Consistent Hashing）环」——但官方 Redis Cluster 明确说：它不用一致性哈希，而用固定的 16384 个哈希槽（hash slots）。本篇接在 <a class="notion-link" href="https://ximouzhao.com/article/redis-persistence-rdb-aof" target="_blank" rel="noopener noreferrer">持久化</a> 与 <a class="notion-link" href="https://ximouzhao.com/article/redis-replication-sentinel" target="_blank" rel="noopener noreferrer">复制 / Sentinel</a> 之后，讲水平扩展这一层承诺什么、不承诺什么。整张地图见<a class="notion-link" href="https://ximouzhao.com/article/redis-standalone-to-cluster" target="_blank" rel="noopener noreferrer">从单机到分片</a>。</div></div></div><div class="notion-text notion-block-1fdbd8d7b20049d0aac8c4aef76fbd2b">系列压力阶梯（全系列同一张图；本篇钉住「16384槽(A3)」）。整图说明见<a class="notion-link" href="https://ximouzhao.com/article/redis-standalone-to-cluster" target="_blank" rel="noopener noreferrer">从单机到分片</a>。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-74a15c1444184eb898c99e20dc34da13" data-id="74a15c1444184eb898c99e20dc34da13"><span><div id="74a15c1444184eb898c99e20dc34da13" class="notion-header-anchor"></div><a class="notion-hash-link" href="#74a15c1444184eb898c99e20dc34da13" title="单机内存不够时，你以为会做「一致性哈希」"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">单机内存不够时，你以为会做「一致性哈希」</span></span></h3><div class="notion-text notion-block-d4ec14e8d032417ea6f10684c119338e">一台 master 内存触顶之后，常见直觉是：把键空间切到多台机器上，用一致性哈希环减少「加减节点时整库搬家」。很多客户端或代理分片方案确实走这条路。</div><div class="notion-text notion-block-165a131466ce4023912720bf0b78b013">Redis Cluster 的官方答案不同：不使用一致性哈希，而是把键空间切成固定数量的哈希槽，再把槽分配给各 master。扩容、缩容时移动的是「槽」（及其上的键），不是重新在环上找邻居。</div><div class="notion-callout notion-yellow_background_co notion-block-d52a5a55fde44a15b49b87b6920b51c6"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="⚠️">⚠️</span></div><div class="notion-callout-text"><div class="notion-text notion-block-2cdd739dbcf7448e8365d1f363d28c50">记住边界：社区口头常说「Redis 用一致性哈希」——那通常指客户端/代理自建分片。官方 Cluster 协议明确否定一致性哈希，主机制是 16384 个哈希槽。</div></div></div><div class="notion-text notion-block-f0a329f19b8e4bfc97914b489d178189">开篇先对照两种切法（对比客户端/代理思路 vs Cluster；不涉及任何具名代理的具体算法）：</div><table class="notion-simple-table notion-block-982756df9e42423bb1ede2ec0c016906"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-15bba393eb214f9b9e56a6dd6946afb2"><td class="" style="width:120px"><div class="notion-simple-table-cell">维度</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">客户端 / 代理一致性哈希（常见对比）</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Redis Cluster（官方）</div></td></tr><tr class="notion-simple-table-row notion-block-4f0d32695f5a4e55a23e2ae1bb0916d7"><td class="" style="width:120px"><div class="notion-simple-table-cell">切分对象</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">按哈希环把键映射到节点</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">固定 16384 哈希槽，键先入槽再跟槽走节点</div></td></tr><tr class="notion-simple-table-row notion-block-19e07c3892ad44e8907f184ce073ec55"><td class="" style="width:120px"><div class="notion-simple-table-cell">加减节点</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">环上邻居范围变化；实现各异</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">在节点间搬迁部分槽，无需停服切分</div></td></tr><tr class="notion-simple-table-row notion-block-2482923d0875461189f0e1d7eea5b768"><td class="" style="width:120px"><div class="notion-simple-table-cell">多键命令</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">取决于你的分片约定</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">同一命令 / 事务 / Lua 涉及的键须同槽</div></td></tr><tr class="notion-simple-table-row notion-block-e60749f74ef743eb9ac6c5d62ff4b20b"><td class="" style="width:120px"><div class="notion-simple-table-cell">路由谁负责</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">客户端或代理算节点</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">客户端算槽；连错则节点返回重定向，默认不代答</div></td></tr></tbody></table><div class="notion-text notion-block-1a90bf80e99b4cad925f2bcbf1a84aff">你这边的 App 仍直接连 Redis；要换的是「怎么知道某个键在哪台机器」，以及「多键操作能不能跨机」。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-4877f05206714d19888d6ded5be655e4" data-id="4877f05206714d19888d6ded5be655e4"><span><div id="4877f05206714d19888d6ded5be655e4" class="notion-header-anchor"></div><a class="notion-hash-link" href="#4877f05206714d19888d6ded5be655e4" title="官方 Cluster 到底怎么切键空间？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">官方 Cluster 到底怎么切键空间？</span></span></h3><div class="notion-text notion-block-164eb3aed9ee4749b28de3b9430fdeee">键空间被切成 16384 个哈希槽。每个 master 负责其中一部分。稳定时，一个槽只由一个 master 服务（其副本可在读扩展场景下提供可能滞后的副本读）。</div><div class="notion-text notion-block-f4adb98c0bd7400cbd3fc67505b6ddae">映射公式是：哈希槽 = CRC16(键) mod 16384（CRC16 取 XMODEM 变体；实现上常用低 14 位，等价于对 16384 取模）。</div><div class="notion-text notion-block-1d557738307a4b1bb218737d1b7a4e04">举例：三节点起步时，槽可以按区间分给 Node A / B / C；加 Node D 时，从 A、B、C 各挪一部分槽过去即可。挪槽可以在线进行：移动的是槽归属与槽内键，不是「把整台机器从环上摘掉再重哈希一切」。</div><div class="notion-text notion-block-43e1db9a079348dc842c7ba5b6a8b6c8">客户端侧的因果链是：</div><ol start="1" class="notion-list notion-list-numbered notion-block-db4522cc94de4b1cb44f7537843f3813" style="list-style-type:decimal"><li>App 给出键名。</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-a3ba4d5b6b0a46b787a8c731e1e9cfef" style="list-style-type:decimal"><li>客户端（或你自己）按公式算出槽。</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-132325bf41c4436ab56b8e422e22b843" style="list-style-type:decimal"><li>查本地「槽 → 节点」映射，直连对应节点。</li></ol><ol start="4" class="notion-list notion-list-numbered notion-block-cf42d22d3b1e46319156ec8f3738f505" style="list-style-type:decimal"><li>映射过期或连错时，节点用重定向把你纠正回来（下一节）。</li></ol><div class="notion-text notion-block-e5d512369ed448efb17bd807686bcc1e">节点之间另有集群总线（cluster bus）做故障检测与配置传播；客户端只应打命令端口，不要去打总线端口。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-de86ecb29bfa4576a3c8c594b6ff4276" data-id="de86ecb29bfa4576a3c8c594b6ff4276"><span><div id="de86ecb29bfa4576a3c8c594b6ff4276" class="notion-header-anchor"></div><a class="notion-hash-link" href="#de86ecb29bfa4576a3c8c594b6ff4276" title="{user:42} 在救什么？又会制造什么热点？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><code class="notion-inline-code">{user:42}</code> 在救什么？又会制造什么热点？</span></span></h3><div class="notion-text notion-block-f4da4e9f39474858bc52de4e5b8afa8d">多键命令、事务、Lua 脚本在 Cluster 里有硬约束：一次执行里涉及的所有键必须落在同一个哈希槽。否则节点会拒绝这类跨槽操作。</div><div class="notion-text notion-block-69e82b5c191a4b4f8e8f8c6043726fed">哈希标签（hash tag）就是为同槽而生的例外规则：若键名里出现成对的花括号，且 <code class="notion-inline-code">{</code> 与其后第一个 <code class="notion-inline-code">}</code> 之间有至少一个字符，则只哈希花括号内的子串来算槽。</div><div class="notion-text notion-block-87afa918aa0f459e9e11aa8e0e61ad96">因此 <code class="notion-inline-code">user:{123}:profile</code> 与 <code class="notion-inline-code">user:{123}:account</code> 保证同槽，可以一起做多键操作。官方示例里，<code class="notion-inline-code">{user1000}.following</code> 与 <code class="notion-inline-code">{user1000}.followers</code> 同理。</div><div class="notion-text notion-block-84284272419d4e3bb587191f6c484e94">规则也有「看起来有花括号其实无效」的情况：例如中间为空的标签，整键照常哈希。写键名时要按规范核对，不要凭感觉。</div><div class="notion-text notion-block-00027733ddad4619be205f2821f05d73">它救的是：购物车里「同一用户的多条相关键」要原子或同次脚本处理。它制造的风险是：若大量热键共用同一个标签（例如全站都用 <code class="notion-inline-code">{shop}</code>），它们会挤进同一槽、同一 master——水平扩展在容量上失效，热点仍然打在一台机器上。</div><div class="notion-text notion-block-9f222b85dbd9458d80d65eb6f91128c2">标签是「强制同槽」的工具，不是「自动打散热点」的工具。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-59f9de6811544276ac62fcd35110f858" data-id="59f9de6811544276ac62fcd35110f858"><span><div id="59f9de6811544276ac62fcd35110f858" class="notion-header-anchor"></div><a class="notion-hash-link" href="#59f9de6811544276ac62fcd35110f858" title="连错节点时，MOVED 和 ASK 差在哪？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">连错节点时，MOVED 和 ASK 差在哪？</span></span></h3><div class="notion-text notion-block-4c2eaccf605a46ac91e5781f6863de63">Cluster 节点默认不代理请求。你连到「当前不负责该槽」的节点时，它返回重定向错误，让客户端改连。两种重定向语义不同：</div><ul class="notion-list notion-list-disc notion-block-a46909ca3f004a498b78838ec3ce0e1b"><li>MOVED：集群认为该槽已经（或应被视作）由另一节点长期负责。客户端应更新本地「槽 → 节点」映射，后续直接打新地址。</li></ul><ul class="notion-list notion-list-disc notion-block-750cfd541f7e423cb14b61f2745ac89b"><li>ASK：常见于槽正在从 A 迁到 B 的窗口。A 上若键已不在本地，会让你这一次去 B 试；客户端应对 B 先发 ASKING，再发原命令，且不要把槽永久改记到 B。迁完之后才会出现 MOVED，再固化映射。</li></ul><div class="notion-text notion-block-2127098762724c5d849c1405ce28bde1">成熟的 Cluster 客户端会在启动和收到 MOVED 时刷新槽表（例如用 CLUSTER SLOTS / CLUSTER SHARDS），平时直连正确节点，把重定向变成偶发事件。若客户端既不懂 MOVED 也不懂 ASK，就不能算完整的 Cluster 客户端。</div><details class="notion-toggle notion-block-f9cbb0add7c64e7fa40157d4ceceba2c"><summary>迁槽期间多键操作为什么可能看到 TRYAGAIN？</summary><div><div class="notion-text notion-block-f1286da1e076460098c60de985274bd5">即使所有键名义上同槽，迁槽过程中键可能暂时一部分还在源节点、一部分已在目标节点。此时针对「不存在或已拆开」的多键操作可能返回 TRYAGAIN：客户端可稍后重试，或把错误上报给调用方。单键操作在迁槽期间仍可按 MOVED/ASK 规则继续；迁槽结束后，该槽上的多键操作恢复可用。</div></div></details><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-af1d6dbb84574f229803f8a05c73f2d3" data-id="af1d6dbb84574f229803f8a05c73f2d3"><span><div id="af1d6dbb84574f229803f8a05c73f2d3" class="notion-header-anchor"></div><a class="notion-hash-link" href="#af1d6dbb84574f229803f8a05c73f2d3" title="为什么多键事务/Lua 在 Cluster 里动不动就报错？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">为什么多键事务/Lua 在 Cluster 里动不动就报错？</span></span></h3><div class="notion-text notion-block-92cd44cc19c947d49050b6dd1cf6718b">根因通常不是「事务坏了」，而是跨槽。</div><ul class="notion-list notion-list-disc notion-block-b455c646269a4547af11c3c00c82770e"><li><code class="notion-inline-code">MSET a 1 b 2</code>：若 a 与 b 算出不同槽 → 失败。</li></ul><ul class="notion-list notion-list-disc notion-block-4820b30fad524914ad1176c29401e986"><li>MULTI / EXEC 包住多键、或 Lua 里访问多个键：同样要求整次执行落在同一槽。</li></ul><ul class="notion-list notion-list-disc notion-block-0d62321e62684824a0007b46e8fe73b4"><li>没有共同哈希标签、又按业务随意起名的键，很容易散落在不同槽。</li></ul><div class="notion-text notion-block-c1461ea7d26c4000b1733898e500b32d">可行路径只有两条：</div><ol start="1" class="notion-list notion-list-numbered notion-block-6d844354bda64c7b8931ac704b1ce981" style="list-style-type:decimal"><li>把必须一起动的键设计进同一哈希标签；或</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-6773b2191ab348feada20279a79df888" style="list-style-type:decimal"><li>改成多次单键命令，由应用自己拼一致性（并接受失去单次多键原子语义）。</li></ol><div class="notion-text notion-block-e5bf9b3592954f28951cfaa1ca14b23f">从「能跑的单机 Redis」迁到 Cluster 时，官方也把「多键且无相同标签」列为必须改应用的一类。Pipeline 减的是往返次数，不取消同槽约束；同槽细节若要展开，属于客户端效率专题，本篇只钉住 Cluster 的硬边界。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-551118f0360541458fc8cb2f64c5c735" data-id="551118f0360541458fc8cb2f64c5c735"><span><div id="551118f0360541458fc8cb2f64c5c735" class="notion-header-anchor"></div><a class="notion-hash-link" href="#551118f0360541458fc8cb2f64c5c735" title="生产常见 6 节点在防哪些挂法？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">生产常见 6 节点在防哪些挂法？</span></span></h3><div class="notion-text notion-block-64eaba7decf94dbc8b4e739651f2d25a">最小可运行的 Cluster 需要至少 3 个 master（多数派故障判定与选举需要足够的 master）。生产上官方强烈建议 6 节点：3 个 master + 3 个 replica（每个 master 一根副本）。</div><div class="notion-text notion-block-a5c9f3486e5d4592abb31af55a44153b">这套拓扑在防什么：</div><table class="notion-simple-table notion-block-a578cbf1ba8d4b9bbbe019a133c1e521"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-fac56bfd9dda480cae58040bb2073d76"><td class="" style="width:120px"><div class="notion-simple-table-cell">挂法</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">大约会发生什么</div></td></tr><tr class="notion-simple-table-row notion-block-28654c560146421ebefe344a1d3e6d49"><td class="" style="width:120px"><div class="notion-simple-table-cell">单个 master 挂</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">对应 replica 可被提升，该槽区间继续服务</div></td></tr><tr class="notion-simple-table-row notion-block-1ad237ba5fab4ff790d5f3c7f4aa59f1"><td class="" style="width:120px"><div class="notion-simple-table-cell">某 master 与其唯一 replica 同时挂</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">这些槽无法服务；覆盖不全时集群可能拒写（视配置）</div></td></tr><tr class="notion-simple-table-row notion-block-03d20d2f272447c684ed4061ab9dcc5e"><td class="" style="width:120px"><div class="notion-simple-table-cell">少数派网络分区</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">少数侧写窗口有上限；多数侧在超时后可选举并恢复可用</div></td></tr></tbody></table><div class="notion-text notion-block-8cca489dddfa4e7fb06d5f050723a51a">可用性条件可以记成：多数 master 可达，且每个故障 master 至少还有可达副本可顶上。副本迁移（replicas migration）还能在「某个 master 变孤儿」时，从「副本较多」的 master 挪一根副本过去，降低「先后两次单点故障打穿同一分片」的概率——但若一对 master+replica 同时没了，槽仍会空洞。</div><div class="notion-text notion-block-dc3621507d37472abfa6e156ce6c4088">对比上一篇的 Sentinel：Sentinel 解决的是单分片自动切主；当你确认「数据集已经装不进一台 master」时，才需要 Cluster 这种按槽水平切开的拓扑。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-4e5c7f8f222645029cdd163dcaf3ee7b" data-id="4e5c7f8f222645029cdd163dcaf3ee7b"><span><div id="4e5c7f8f222645029cdd163dcaf3ee7b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#4e5c7f8f222645029cdd163dcaf3ee7b" title="Cluster 承诺可用性，不承诺你刚写入永不丢"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">Cluster 承诺可用性，不承诺你刚写入永不丢</span></span></h3><div class="notion-text notion-block-ff1305a8128644bebd733630ac945e22">官方写得很直：Redis Cluster 不保证强一致性（strong consistency）。在特定故障下，已经向客户端确认（acknowledged）的写入仍可能丢失。</div><div class="notion-text notion-block-1ada5bda29c3430b8ca10834835690e9">主因与 <a class="notion-link" href="https://ximouzhao.com/article/redis-replication-sentinel" target="_blank" rel="noopener noreferrer">复制篇</a> 同源：主从复制默认是异步的。典型顺序是：</div><ol start="1" class="notion-list notion-list-numbered notion-block-b222cb23342740b0b288f52a429a4dad" style="list-style-type:decimal"><li>客户端写到 master B；</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-77a7589f8cd2453d9f2da5e53f5c8c2c" style="list-style-type:decimal"><li>B 先回复 OK；</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-8f2d416d6f63408b8aa7bf4b26941333" style="list-style-type:decimal"><li>B 再把写传播给副本。</li></ol><div class="notion-text notion-block-5b66f14d9159436b80bed2d982b687b3">若 B 在传播前崩溃，且未收到该写的副本被提升为新主，这次已确认写入就没了。WAIT 可以把「等副本确认」做进路径，降低丢失概率，但官方仍明确：即便使用同步复制语义，Cluster 也不因此变成强一致。</div><div class="notion-text notion-block-0393dfe9b1e0497babc13cc7a8301c07">另一类窗口出现在网络分区：客户端与少数派（含某 master）困在一侧时，仍可能短暂写入；多数派超时后提升副本，少数派上的写入会丢。节点超时（cluster-node-timeout）既约束「多久算失败、可被 failover」，也约束少数派「多久之后停止接受写入」——因此丢失窗口有上限，但上限之内的已确认写并不安全。</div><div class="notion-text notion-block-60ce13f80e2e4829bf8b758d19128d05">所以：Cluster 帮你把键空间摊到多机，并在「多数派 + 有副本可顶」时维持分片可用；它不把「写成功回包」升级成跨故障的永不丢承诺。需要更窄丢失窗口时，仍要回到持久化策略与复制确认（见系列前文），并在业务层接受最终一致或补偿。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-f11c53a5506040a2a57380d4965a1b8b" data-id="f11c53a5506040a2a57380d4965a1b8b"><span><div id="f11c53a5506040a2a57380d4965a1b8b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#f11c53a5506040a2a57380d4965a1b8b" title="因果收束：从「环」到「槽」"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">因果收束：从「环」到「槽」</span></span></h3><div class="notion-text notion-block-f0923e6ff54c4445a380d5f581ca4f69">你以为扩容靠一致性哈希环；官方 Cluster 用的是固定 16384 槽：键 → CRC16 → 槽 → 节点。哈希标签把多键拧进同槽，也会把热点拧进同槽。连错节点时，MOVED 改永久映射，ASK 只改下一次（配合 ASKING）。多键事务与 Lua 报错，多半是跨槽。生产常见 3+3 防的是单 master 挂；主从双挂仍会让槽不可用。可用性有条件，已确认写入在异步复制与分区下仍可能丢。</div><div class="notion-text notion-block-ed0fd4b0949440e3aed03ab52aaca383">上线前可自检：</div><div class="notion-to-do notion-block-2e1e6a10502442469ab17501239b7029"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">客户端是 Cluster 感知的，能处理 MOVED 与 ASK</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-4e444859946c4de4892189fe1317d1de"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">必须同事务 / 同 Lua 的键已用哈希标签对齐，并评估热槽</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-08afc286fc944e67b276302221ec880d"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">至少 3 个 master；生产按 3 master + 3 replica 部署，且故障域分开</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-7d030aac6270469682f1fdb94017dadb"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">业务接受「非强一致」；关键写结合持久化与复制确认策略</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-8015c7d36b2048bcafc361090840a59d"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">迁槽 / 扩容窗口预留重试（含可能的 TRYAGAIN）</div></div><div class="notion-to-do-children"></div></div><details class="notion-toggle notion-block-4e276396a84f4c0ebd0fe82f5cca43d7"><summary>Sources</summary><div><div class="notion-text notion-block-cff2fbc0b8374026be3d63d59ae31762">证据复核日期：2026-08-15。</div><div class="notion-text notion-block-ef446e3fe480489cb14369ada2d17986">Scale with Redis Cluster：<a class="notion-link" href="https://redis.io/docs/latest/operate/oss_and_stack/management/scaling/" target="_blank" rel="noopener noreferrer">https://redis.io/docs/latest/operate/oss_and_stack/management/scaling/</a></div><div class="notion-text notion-block-a5e5fd15a3f54693b9b72959b8d9a692">Redis cluster specification：<a class="notion-link" href="https://redis.io/docs/latest/operate/oss_and_stack/reference/cluster-spec/" target="_blank" rel="noopener noreferrer">https://redis.io/docs/latest/operate/oss_and_stack/reference/cluster-spec/</a></div><div class="notion-text notion-block-5c896dbecb44486f8e72ea4fd7e5feab">系列前文：<a class="notion-link" href="https://ximouzhao.com/article/redis-persistence-rdb-aof" target="_blank" rel="noopener noreferrer">https://ximouzhao.com/article/redis-persistence-rdb-aof</a> · <a class="notion-link" href="https://ximouzhao.com/article/redis-replication-sentinel" target="_blank" rel="noopener noreferrer">https://ximouzhao.com/article/redis-replication-sentinel</a></div></div></details></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[主节点挂了，副本为什么不一定有你刚写入的数据？]]></title>
            <link>https://ximouzhao.com/article/redis-replication-sentinel</link>
            <guid>https://ximouzhao.com/article/redis-replication-sentinel</guid>
            <pubDate>Sat, 15 Aug 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[从主挂事故讲清异步复制、PSYNC、WAIT 边界，以及 Sentinel 自动切换的适用条件与丢写窗口。]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-3bc4b0ac588b818d9227d1a86e11a424"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-callout notion-blue_background_co notion-block-353e0cd76aba4b4a8a644cbcc41d0dd3"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="🛒">🛒</span></div><div class="notion-callout-text"><div class="notion-text notion-block-18b93cc7df2a4c46a92b965512b36f9b">Redis 已经加了副本，监控也配了自动切换。主节点突然挂了，Sentinel 很快选出新主，App 重新连上——可刚确认成功的那一笔购物车写入，新主上却没有。本文只回答一件事：异步复制与 Sentinel 自动切换各自承诺什么、不承诺什么，以及「写成功了」为何仍可能丢。</div></div></div><div class="notion-text notion-block-afe89f1385ea40f286849f2f13892d94">系列压力阶梯（全系列同一张图；本篇钉住「主从+Sentinel(A2)」）。整图说明见<a class="notion-link" href="https://ximouzhao.com/article/redis-standalone-to-cluster" target="_blank" rel="noopener noreferrer">从单机到分片</a>。</div><div class="notion-text notion-block-a1145ad233624489b06924c9443a140c">系列上一篇讲的是<a class="notion-link" href="https://ximouzhao.com/article/redis-persistence-rdb-aof" target="_blank" rel="noopener noreferrer">本机磁盘还剩什么</a>（RDB / AOF 与丢失窗口）；本文接着讲：<b>主挂之后，副本与自动切换能不能保住你刚拿到的成功应答</b>。缓存怎么跟数据库配合，是同站另一类问题，这里不展开。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-4d67836dc45e4d85894ddef77aa716d3" data-id="4d67836dc45e4d85894ddef77aa716d3"><span><div id="4d67836dc45e4d85894ddef77aa716d3" class="notion-header-anchor"></div><a class="notion-hash-link" href="#4d67836dc45e4d85894ddef77aa716d3" title="加了副本，为什么写成功仍可能丢？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">加了副本，为什么写成功仍可能丢？</span></span></h3><div class="notion-text notion-block-61456bf1fd094a219ae6262038da0f15">事故现场通常很像这样：App 对 master 写入购物车，命令返回成功；片刻后 master 宕机，Sentinel 把某台副本提升为新主；你再读，刚写下的键不见了。</div><div class="notion-text notion-block-c03083e8adaa40b0b062994a4076d197">先固定四个角色，后面整篇都围着它们转：</div><ul class="notion-list notion-list-disc notion-block-52fdc75de402458aa579e966d9cdabd8"><li><b>你 / App</b>：对当前 master 发写命令，等成功应答。</li></ul><ul class="notion-list notion-list-disc notion-block-475a0a0402d845358b843451b08d7bee"><li><b>master（主节点）</b>：接受写入、改自己的内存，并把复制流推给副本。</li></ul><ul class="notion-list notion-list-disc notion-block-9226207e19c94cf991ed1cc3604d781a"><li><b>replica（副本）</b>：跟随 master 的复制流；默认不决定你何时收到写成功。</li></ul><ul class="notion-list notion-list-disc notion-block-74c6deaabeed453c8fe4e75c55ba7499"><li><b>Sentinel（哨兵）</b>：监控、投票、自动 failover（故障切换），并给客户端提供「现在谁是主」的配置发现——它不替你把未复制的写入变出来。</li></ul><div class="notion-text notion-block-4b67adb8f3b74c7bab3b236721fa8cff">Redis 默认使用异步复制（asynchronous replication）：master 在内存里完成写入并向客户端应答成功时，不会先等副本确认「我已经收到并应用了这笔写」。副本通常很快跟上，但中间永远存在一段「主已 ACK、副本尚未应用」的时间窗。主若正好在这段窗口里挂掉，提升上来的新主就可能没有那笔数据。</div><div class="notion-text notion-block-91365f96b36a406d9910e366646a60f8">读这张图时抓住一点：客户端成功不等于副本已有。加副本解决的是「主挂了还有份内存可提升、读可以分担」，不是「每笔已成功的写都已在副本落稳」。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-de6442049d8a433398b8ab96cf4e447a" data-id="de6442049d8a433398b8ab96cf4e447a"><span><div id="de6442049d8a433398b8ab96cf4e447a" class="notion-header-anchor"></div><a class="notion-hash-link" href="#de6442049d8a433398b8ab96cf4e447a" title="断线重连：何时只补缺口，何时整库重来？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">断线重连：何时只补缺口，何时整库重来？</span></span></h3><div class="notion-text notion-block-9e625639bb30461bbd00fe7cb8158780">副本与 master 之间的连接会断、会抖。重连时 Redis 尽量走 PSYNC（Partial Resynchronization，部分重同步）：用复制 ID（replication ID）和复制偏移量（offset），再配合 master 上的复制积压缓冲区（replication backlog），只把断线期间缺的那段命令补回去。</div><div class="notion-text notion-block-1df8c484174c40f1baf7efc394b6fc8f">补不回来时，就退化为全量重同步（full resynchronization）：master 生成 RDB 快照发给副本，再跟上快照之后的增量流——代价更大，窗口也更长。</div><table class="notion-simple-table notion-block-4c0dd03ae2af455daa42cdd7a1c3a7e0"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-5af175f41a0048dbb8a1d38ffddcb8a7"><td class="" style="width:120px"><div class="notion-simple-table-cell">重连结果</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">大致条件</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">你看到的代价</div></td></tr><tr class="notion-simple-table-row notion-block-f812ca0bd0984478bb4d99d577a0489e"><td class="" style="width:120px"><div class="notion-simple-table-cell">部分重同步（PSYNC）</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">复制 ID 仍匹配；缺口落在 backlog 内</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">只补偏移量之间的命令</div></td></tr><tr class="notion-simple-table-row notion-block-185452ef90184332bfba6f8976fb66fc"><td class="" style="width:120px"><div class="notion-simple-table-cell">全量重同步</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">复制历史对不上；缺口超出 backlog；或其它无法部分续传的情况</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">RDB 快照 + 后续流；更重、更久</div></td></tr></tbody></table><div class="notion-text notion-block-c629716e69b641ca8c2f8f5eaa74862f">PSYNC 不消灭上一节的异步丢写窗口：它管的是「断线后怎么尽快对齐」，不是「主在 ACK 时是否已等副本」。backlog 配太小、断线太久，更容易整库重来——运维上要按流量与抖动现实估 backlog，而不是假设「有副本就永远增量」。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-60cd11b5980e42d09e3864fddd809ccd" data-id="60cd11b5980e42d09e3864fddd809ccd"><span><div id="60cd11b5980e42d09e3864fddd809ccd" class="notion-header-anchor"></div><a class="notion-hash-link" href="#60cd11b5980e42d09e3864fddd809ccd" title="WAIT 能让你睡得更香吗？它承诺了什么？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">WAIT 能让你睡得更香吗？它承诺了什么？</span></span></h3><div class="notion-text notion-block-23dc96de53ca44edbde81cf19e916933">若某类写入你更不能丢（例如关键 session、结算前购物车快照），可以在写成功之后再发 WAIT：它会阻塞当前客户端，直到至少 N 个副本确认已经收到此前的写，或等到超时。</div><div class="notion-text notion-block-e55cc329523c4e2094e4e267397c3efc">它承诺的是：在超时前，尽量把「副本确认数」推高，从而缩小 failover 时丢掉已 ACK 写的真实概率。官方也写明：这在 Sentinel / Cluster 的故障切换场景里能改善现实安全性。</div><div class="notion-text notion-block-27baf34044d2404190f83738aac8dd64">它不承诺的是：</div><ul class="notion-list notion-list-disc notion-block-db54fa34d98945bdb8d6d5ea9c2145e9"><li>不把 Redis 变成强一致（strongly consistent）系统；</li></ul><ul class="notion-list notion-list-disc notion-block-2589a27b0a4e48e684a59677a9db89c0"><li>不保证超时后「一定已经安全」——你必须检查 WAIT 返回的副本确认数是否大于或等于你要求的 N；</li></ul><ul class="notion-list notion-list-disc notion-block-f266f82dd69d4a3881396e9db76b0020"><li>不消除所有丢写路径（例如确认之后副本又挂、或切换选中了仍落后的节点等现实组合）。</li></ul><div class="notion-callout notion-orange_background_co notion-block-9cd68394dfc84e3eb9d680163a9cac80"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="⚠️">⚠️</span></div><div class="notion-callout-text"><div class="notion-text notion-block-44d88d27e4e24988ae2c88851a2b56ce">WAIT 是可选的同步确认台阶，不是分布式事务，也不是「写成功 = 永不可丢」。调用方把返回值当一等公民；把 WAIT 当成强一致开关，会在事故里误判。</div></div></div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-9e727dea0f75476fa47f50bb5ea31a81" data-id="9e727dea0f75476fa47f50bb5ea31a81"><span><div id="9e727dea0f75476fa47f50bb5ea31a81" class="notion-header-anchor"></div><a class="notion-hash-link" href="#9e727dea0f75476fa47f50bb5ea31a81" title="无持久化的 master 自动拉起，为什么更危险？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">无持久化的 master 自动拉起，为什么更危险？</span></span></h3><div class="notion-text notion-block-f732bfce7e9b487eb050d3e9307a3dbc">系列上一篇已经钉过：无持久化时，进程没了，本机内存数据就没了。复制拓扑里还有更狠的一跳。</div><div class="notion-text notion-block-4f43b213d1d04dddaab65b826a522144">官方在复制文档里强烈提醒：若 master 没有持久化，又被自动重启成一个空实例，而副本随后向这份「空主」同步，副本上原来还在的数据可能被冲成空库。也就是说：你以为「至少副本还活着」，结果空主一归队，把幸存副本一起拖下水。</div><div class="notion-text notion-block-0bf7e7e08cb8461c825d3e83622027ac">官方建议很直接：给 Redis 打开持久化；或者不要让无持久化的实例在崩溃后自动拉起就继续当可同步的 master。Sentinel 解决的是「谁来当主」；它不自动修复「空主被当成权威数据源」这种配置事故。</div><details class="notion-toggle notion-block-d42dc10a686548509f89babae301c2aa"><summary>这和「本机 RDB/AOF 丢几秒」差在哪？</summary><div><div class="notion-text notion-block-1eb6e7d9c9c841f7aaa9ec2b021c263d">本机持久化讨论的是：单进程崩溃后，磁盘上还能装回多少。空主陷阱讨论的是：复制拓扑里，一份错误的权威空数据集，通过同步把别的节点也清空。两层都要管；只开 Sentinel、却让无持久化 master 自动归队，危险面更大。</div></div></details><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-94d3ac8efe65400e9d7155f7d5fccaf4" data-id="94d3ac8efe65400e9d7155f7d5fccaf4"><span><div id="94d3ac8efe65400e9d7155f7d5fccaf4" class="notion-header-anchor"></div><a class="notion-hash-link" href="#94d3ac8efe65400e9d7155f7d5fccaf4" title="只要自动切换、数据还装得进一台：为什么是 Sentinel？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">只要自动切换、数据还装得进一台：为什么是 Sentinel？</span></span></h3><div class="notion-text notion-block-fa52836881c940fe945eba9bdca4c369">当你的问题是「单分片数据还装得进一台机器，但主挂了要自动切、客户端要知道新主在哪」，官方给出的非 Cluster 答案是 Redis Sentinel。</div><div class="notion-text notion-block-1aec9cc250114bce9510ed18fdfd3e8c">Sentinel 提供四件事（官方能力清单）：</div><ol start="1" class="notion-list notion-list-numbered notion-block-b31ee223a1f24875a193e889260325ca" style="list-style-type:decimal"><li>监控（monitoring）：Sentinel 是否觉得实例按预期在工作。</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-dd0fca0193b946d7aa13d4ec9b15d548" style="list-style-type:decimal"><li>通知（notification）：可通过 API 把事件推给管理员或其他程序。</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-f48551044b3f416bb3e6face16d122a9" style="list-style-type:decimal"><li>自动故障切换（automatic failover）：主不可用时，把副本提升为新主，并让其它副本跟随新主。</li></ol><ol start="4" class="notion-list notion-list-numbered notion-block-25a36b1ca2c14d3db04b22069543b8a4" style="list-style-type:decimal"><li>配置提供者（configuration provider）：客户端问 Sentinel「当前 master 是谁」，而不是把地址写死在配置文件里。</li></ol><div class="notion-text notion-block-33055492977d4a4687f84614570589d5">部署上，官方要求：至少 3 个 Sentinel，并放进独立的故障域（不要三个进程挤在同一台机、同一电源、同一网络故障点上「看起来有三票」）。客户端也必须真正支持 Sentinel 发现，而不是 failover 后仍死盯旧 IP。</div><div class="notion-text notion-block-d70237c903fc492cbf24864a86d52e3b">Sentinel 做不到的事也要说清：它不做哈希槽分片，不把单机内存上限变没；异步复制下，已向客户端确认的写仍可能在切换后丢失——这与上一节同一因果链。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-c341cdfb0f3c45d0aa0e17150766e654" data-id="c341cdfb0f3c45d0aa0e17150766e654"><span><div id="c341cdfb0f3c45d0aa0e17150766e654" class="notion-header-anchor"></div><a class="notion-hash-link" href="#c341cdfb0f3c45d0aa0e17150766e654" title="SDOWN 到切换成功，中间谁说了算？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">SDOWN 到切换成功，中间谁说了算？</span></span></h3><div class="notion-text notion-block-447f9434c21747d9a6849475220d170f">自动切换不是「任意一个 Sentinel 觉得挂了就立刻切」。官方把主观与客观分开：</div><ul class="notion-list notion-list-disc notion-block-1b7aa375b32b47c9970f5481f37959bf"><li>SDOWN（Subjectively Down，主观下线）：单个 Sentinel 自己认为实例不可达。</li></ul><ul class="notion-list notion-list-disc notion-block-41acf28a5ae445e6a8bbaaa5ec9b5a58"><li>ODOWN（Objectively Down，客观下线）：达到配置的 quorum（法定人数）——足够多的 Sentinel 同意「master 真的不行了」——之后，才把 master 标成客观下线。</li></ul><div class="notion-text notion-block-7f60be07ee07421192bbceb30fc7e5a9">quorum 回答的是：「多少 Sentinel 同意不可达，才把 master 标成 ODOWN」。真正授权并完成 failover，还需要 Sentinel 集合里能够形成多数派（majority）；若只有少数 Sentinel 活在一个网络分区里，它们不应擅自完成切换——否则脑裂风险会反噬你。</div><div class="notion-text notion-block-bfd1ac4bcac5401d85a15ec25aa15038">因此：监控可以敏感，切换必须「够多人同意」。配 2 个 Sentinel「凑合用」，既不满足官方至少 3 个的独立故障域建议，也容易在分区里失去可靠的多数判断。</div><details class="notion-toggle notion-block-44214d04aa3643a59fdb60415d8a99d7"><summary>Docker / NAT 下 Sentinel 为什么特别容易踩坑？</summary><div><div class="notion-text notion-block-d3484de7cf1745b89e49f73d47b0620f">官方 Sentinel 文档提醒：在 Docker、NAT 或地址翻译环境里，Sentinel 与 Redis 互相宣告的 IP/端口可能和客户端真实可达地址不一致。结果是「Sentinel 内部觉得切成功了」，App 却连错地址或连到不可达端口。部署前先核对：Sentinel 发布的 master 地址，是否就是客户端网络里可达的那一个。</div></div></details><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-2532a85a166949bfbabd32e575d4b34b" data-id="2532a85a166949bfbabd32e575d4b34b"><span><div id="2532a85a166949bfbabd32e575d4b34b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2532a85a166949bfbabd32e575d4b34b" title="什么时候不该停在 Sentinel，而要走向 Cluster？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">什么时候不该停在 Sentinel，而要走向 Cluster？</span></span></h3><div class="notion-text notion-block-74dc389c9ff5443e958c839df9218ab5">Sentinel 适合：还要自动切换，且整库数据与负载仍装得进单个 master（单分片心智），并接受「全键操作仍在一个主上」的模型。</div><div class="notion-text notion-block-0114729421bc49f8a4833c4103ba141c">当你的压力变成「一台的内存 / 写入打满了，必须水平切开键空间」，就该走向 Redis Cluster（集群）：用固定哈希槽把键分散到多个主节点。选型可以收成下面这张决策图：</div><div class="notion-text notion-block-fc50ea502b2b49f3b068243170dee9cb">Cluster 不是「Sentinel 加强版」：它换的是数据面拓扑（多主分片），不是把异步复制改成强一致。下一篇会专门讲槽怎么切、客户端如何纠正路由；本文只帮你判断：什么时候不该再假装一台永远够用。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-f05cc561f7af496fb100a42e8892e936" data-id="f05cc561f7af496fb100a42e8892e936"><span><div id="f05cc561f7af496fb100a42e8892e936" class="notion-header-anchor"></div><a class="notion-hash-link" href="#f05cc561f7af496fb100a42e8892e936" title="因果收束"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">因果收束</span></span></h3><div class="notion-text notion-block-ebe22592e1d041dfaad3ddc7638265b0">你写入 → master 内存先改并应答 → 复制流异步追副本（默认不等待）→ 主在「未送达窗口」挂掉，新主可能没有刚 ACK 的写 → WAIT 只提高副本确认数、不是强一致 → 无持久化空主自动归队可能拖死副本 → Sentinel（至少 3 个、独立故障域、客户端感知）负责单分片监控与切主，ODOWN 看 quorum、真正切换还要 Sentinel 多数 → 单机装不下再上 Cluster。</div><div class="notion-to-do notion-block-c3b800057b22468b8a4c9fa2f4fa632c"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">默认复制是异步的：成功应答不等于副本已应用。</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-1b44df88f94044a3bc6d1248c3af199e"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">关键写入评估 WAIT，并检查返回的确认数大于或等于要求的 N。</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-ec4cbb562afc4fe2be6646d582faf31d"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">master 打开持久化；避免无持久化实例崩溃后自动当空主再同步。</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-04dc070fe46b4e90bb0cf3e5786dc6db"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">Sentinel 至少 3 个，放进独立故障域；客户端用 Sentinel 发现当前 master。</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-9bd6892eac59450b8f7a5e6cb4e5088e"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">理解 quorum（客观下线）与多数派（真正 failover）不是同一句话。</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-78195a7916f244ffb3bb674142827b94"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">数据仍单分片装得下 → Sentinel；必须水平切开 → Cluster（下一篇）。</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-5fde94f4757f41dca9f84a963a9cabcb"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">范围外：托管云控制台专有行为、把本站应用缓存客户端当成服务端机制证明。</div></div><div class="notion-to-do-children"></div></div><blockquote class="notion-quote notion-block-2435fbf688df47dbb235adcc41e0f778"><div>主挂可以自动切；刚成功的写，仍可能停在「未送达」的那一段复制延迟里。</div></blockquote><details class="notion-toggle notion-block-65f458aadd4d4fed8f6eb3b16330f1cb"><summary>来源与更深阅读</summary><div><div class="notion-text notion-block-6ffb39e930c44d19b1f65bc3c8b18803">证据复核日期：2026-08-15。</div><div class="notion-text notion-block-48aa1bd9decf4a8d8f3993ef28b919ff">复制（默认异步、PSYNC / 全量重同步、无持久化空主风险、WAIT 作为可选确认）：<a class="notion-link" href="https://redis.io/docs/latest/operate/oss_and_stack/management/replication/" target="_blank" rel="noopener noreferrer">https://redis.io/docs/latest/operate/oss_and_stack/management/replication/</a></div><div class="notion-text notion-block-596fae6d3f9b48ae90f831c15aed896b">WAIT 命令（阻塞至 N 个副本确认或超时；非强一致；须检查返回值）：<a class="notion-link" href="https://redis.io/docs/latest/commands/wait/" target="_blank" rel="noopener noreferrer">https://redis.io/docs/latest/commands/wait/</a></div><div class="notion-text notion-block-c94335dfab0f43dc9c0c35d4689964ea">Sentinel（非 Cluster 的 HA：监控、通知、自动 failover、配置发现；至少 3 个与故障域；quorum；异步复制下已确认写仍可能丢）：<a class="notion-link" href="https://redis.io/docs/latest/operate/oss_and_stack/management/sentinel/" target="_blank" rel="noopener noreferrer">https://redis.io/docs/latest/operate/oss_and_stack/management/sentinel/</a></div><div class="notion-text notion-block-af1aedf01cc14fef9709e2dd0bbd603d">系列上一篇（本机 RDB/AOF）：<a class="notion-link" href="https://ximouzhao.com/article/redis-persistence-rdb-aof" target="_blank" rel="noopener noreferrer">https://ximouzhao.com/article/redis-persistence-rdb-aof</a></div><div class="notion-text notion-block-60f2fbb55c754cb19026d3af0f0b9651">系列下一篇预告：Redis Cluster 哈希槽与水平扩展（分片、路由纠正与部署形态），不在本文展开。</div></div></details></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[美白精华怎么选：别追榜单，先看诉求和成分]]></title>
            <link>https://ximouzhao.com/article/how-to-choose-whitening-serum</link>
            <guid>https://ximouzhao.com/article/how-to-choose-whitening-serum</guid>
            <pubDate>Sun, 16 Aug 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[把「美白」还原成色素沉着问题：看清紫外线与炎症如何加深斑点，用成分类和防晒决策链挑选精华，并避开氢醌、汞与七天神效话术——不点名网红单品。]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-3be4b0ac588b81269a69f326af67cbed"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-callout notion-blue_background_co notion-block-a803b698bb32430a93752c2a94878aeb"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text"><div class="notion-text notion-block-ac899b1692f44bd5b41820ae8780c255">你盯着一份又一份「美白精华」榜单，想帮她选对，却越看越乱：每一瓶都在承诺提亮，皮肤却各有各的暗沉和斑点。真正要问的不是「哪瓶最火」，而是：她的色素问题像什么、能不能耐受、日常有没有把阳光关住。</div><div class="notion-text notion-block-d9f7e3bf59324c5b988cfbc2ed9a640a">本文是通识决策框架，不是个性化医疗建议；黄褐斑样、妊娠/备孕、严重刺激或长期无效时，应咨询皮肤科医生。</div></div></div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-a1e856ecaf0e45fab24ad9c8cd618af1" data-id="a1e856ecaf0e45fab24ad9c8cd618af1"><span><div id="a1e856ecaf0e45fab24ad9c8cd618af1" class="notion-header-anchor"></div><a class="notion-hash-link" href="#a1e856ecaf0e45fab24ad9c8cd618af1" title="为什么「美白精华」榜单帮不了你？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">为什么「美白精华」榜单帮不了你？</span></span></h3><div class="notion-text notion-block-2406f629fef5431cbe96e51121ab7d32">榜单优化的是点击和话术。你的决策对象是另一套东西：<b>她想改善的外观</b>、<b>她皮肤能扛住的刺激</b>，以及<b>每天仍在上调色素的阳光</b>。</div><div class="notion-text notion-block-1153e6e495254e71918c615f86c3981f">营销里常见「美白 / brightening / lightening」。挑选时更有用的问题名是<b>色素沉着（hyperpigmentation）</b>：肤色不均匀、斑点或暗沉比周围更深。合法产品可以有宣称，但你不必用广告词当决策轴——下文也不点名任何网红单品。</div><div class="notion-text notion-block-7dc727df97d44dd0b528d05ac4a2f780">把问题改写成色素沉着之后，下一步不是背成分浓度，而是先看：<b>这些不均匀是怎么被「造」出来的。</b></div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-abcc2db03b1043c49abe9667654dd23b" data-id="abcc2db03b1043c49abe9667654dd23b"><span><div id="abcc2db03b1043c49abe9667654dd23b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#abcc2db03b1043c49abe9667654dd23b" title="暗沉和斑点，是怎么「造」出来的？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">暗沉和斑点，是怎么「造」出来的？</span></span></h3><div class="notion-text notion-block-7659d3f641f44b02a77135d4d04557b7">决定肤色深浅的关键色素是<b>黑色素（melanin）</b>。<b>紫外线（Ultraviolet，UV）</b>——阳光里肉眼看不见、却会晒黑与晒伤皮肤的那部分波段——以及炎症、激素等因素（例如妊娠相关变化）会让黑色素生成路径更活跃；黑色素增多，外观上就是暗沉、斑点更明显。日常防晒常提到的 <b>UVA（长波紫外线）</b> 与 <b>UVB（中波紫外线）</b> 都是 UV 的细分：UVB 更常和晒红、晒伤挂钩；UVA 穿透更深，也参与晒黑与光老化。</div><div class="notion-text notion-block-9dc630f89b63481a906bb124fbb13da8">看起来都像「斑」，机制却常不一样。粗分是为了选类和预期，<b>不是让你在家自诊</b>；边界不清时交给医生。</div><table class="notion-simple-table notion-block-d51ab56e19e24dd5bda22491d4ab2ed6"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-2d62f855f78d48b08d54fd0d35e26dc1"><td class="" style="width:120px"><div class="notion-simple-table-cell">粗分</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">常见诱因线索</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">预期时间尺度</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">挑选时意味着什么</div></td></tr><tr class="notion-simple-table-row notion-block-93d061acb45645799cc76ad1b11962ef"><td class="" style="width:120px"><div class="notion-simple-table-cell">黄褐斑样（melasma，面颊等处片状加深）</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">日照、激素相关变化更常见</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">改善常按月计，常见约 3–12 个月量级</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">防晒要更严；别用「七天白」设预期</div></td></tr><tr class="notion-simple-table-row notion-block-49f3eafe82564e8f99ac37c0f9a72130"><td class="" style="width:120px"><div class="notion-simple-table-cell">炎症后色素沉着（post-inflammatory hyperpigmentation，PIH）</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">痘印、外伤、刺激性护理后留下的深色印记</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">随炎症控制与周转改善，仍常需耐心</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">先少刺激；强剥脱可能再造斑</div></td></tr><tr class="notion-simple-table-row notion-block-2513ae9e9fdb4203a099349f813d674e"><td class="" style="width:120px"><div class="notion-simple-table-cell">晒斑类（如日光性雀斑样斑，solar lentigines）</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">长期日晒累积更相关</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">日防晒决定会不会继续加深</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">精华帮不上忙时，先查防晒是否到位</div></td></tr></tbody></table><div class="notion-text notion-block-77195015134a4817992f44d43a2de822">同一张脸上可以混有多种线索。你要做的是：用她的描述（痘印 / PIH？蝶形斑？整体发黄暗沉？）做<b>够用的粗分</b>，再进入防晒和成分类——而不是一上来堆「最强美白」。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-d8e472c53c9d4078b752503eb7ad45e4" data-id="d8e472c53c9d4078b752503eb7ad45e4"><span><div id="d8e472c53c9d4078b752503eb7ad45e4" class="notion-header-anchor"></div><a class="notion-hash-link" href="#d8e472c53c9d4078b752503eb7ad45e4" title="为什么防晒往往比精华更先？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">为什么防晒往往比精华更先？</span></span></h3><div class="notion-text notion-block-ee3b9ea3e8b244dfbcf4ac637e2ed1c3">活性成分试图打断黑色素相关步骤；若输入端（前面说的 <b>UV</b>，黄褐斑语境下还有可见光）一直开着，常见结果是：<b>反弹、停滞，或「精华没用」的错觉</b>。</div><div class="notion-text notion-block-31117ac5403a4e0faf8a248f3b9ef7fd">日常底线：选择并坚持 <b>防晒系数（Sun Protection Factor，SPF）30 及以上</b>的防晒。SPF 是包装上常见的防晒强度标示，<b>主要反映对 UVB（中波紫外线，更常导致晒红、晒伤的那一段）的防护能力</b>——数字越大通常防护越强，但仍需足量涂抹并按时补涂。选购时再看是否标注广谱 / broad-spectrum（同时照顾 UVA）；黄褐斑样诉求里，皮肤科公共教育还常提醒可见光，有色（tinted）或含氧化铁等矿物有色防晒常被作为讨论选项——具体选哪一瓶因人而异，本文不点名品牌。</div><div class="notion-callout notion-yellow_background_co notion-block-0f12a88ec9a74e028c77e9b855696eb6"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="⏱️">⏱️</span></div><div class="notion-callout-text"><div class="notion-text notion-block-9b9f6b311b6941928826b867b7be6b38">黄褐斑等色素管理，公开教育里常见的改善时间尺度大约是 <b>3–12 个月</b>，不是「七日白」。遇到「快速美白」「七天见效」类话术，先按不合理预期对待，而不是加码刺激性产品。</div></div></div><div class="notion-text notion-block-d68fc03694b94f2080e5dd4debfbc5d4">防晒做的是关输入；精华做的是在合成、转运或周转里打断一步。两者不是替代关系。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-1b5b59ab59a34951bba6163ea4311afc" data-id="1b5b59ab59a34951bba6163ea4311afc"><span><div id="1b5b59ab59a34951bba6163ea4311afc" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1b5b59ab59a34951bba6163ea4311afc" title="活性成分在打断哪一步？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">活性成分在打断哪一步？</span></span></h3><div class="notion-text notion-block-953a73b22b17428b8ca82395d56586e1">柜面话术喜欢堆成分名。要挑对，先把「变黑」拆成一条可读的流水线——活性成分不是魔法，大多是在这条线的某一环「踩刹车」。</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-fa7367a817be43ce876c9b7f61f7d635" data-id="fa7367a817be43ce876c9b7f61f7d635"><span><div id="fa7367a817be43ce876c9b7f61f7d635" class="notion-header-anchor"></div><a class="notion-hash-link" href="#fa7367a817be43ce876c9b7f61f7d635" title="先看清楚：变黑大概经过哪几环？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">先看清楚：变黑大概经过哪几环？</span></span></h4><div class="notion-text notion-block-90720202cde447d7bb80bee1569efed4">可以把日常可见的暗沉，想成一条从<b>下令生产</b>到<b>送到表面</b>的传送带：</div><ol start="1" class="notion-list notion-list-numbered notion-block-b2b83634f07d439ba6285e631fe7cc46" style="list-style-type:decimal"><li><b>下令</b>：紫外线、炎症、激素等因素，让黑色素细胞更愿意加班。</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-4d684c760a2244b6bacd63445d6d057f" style="list-style-type:decimal"><li><b>造色素</b>：黑色素细胞里，<b>酪氨酸酶（tyrosinase）</b> 等关键酶把原料加工成<b>黑色素（melanin）</b>。</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-9c3d69aa9dd546f7a193a2ce82771735" style="list-style-type:decimal"><li><b>装箱</b>：新造的黑色素装进小包裹——<b>黑素小体（melanosome）</b>。</li></ol><ol start="4" class="notion-list notion-list-numbered notion-block-a616859730dc4a799c7b22f36e09f6c5" style="list-style-type:decimal"><li><b>交货</b>：黑素小体被转交给周围的角质形成细胞。</li></ol><ol start="5" class="notion-list notion-list-numbered notion-block-0a46888931ea42d6bbe1fb4d92830674" style="list-style-type:decimal"><li><b>表面可见</b>：交货完成后，肤色才「看起来更深」——这是你照镜子时看到的那一环。</li></ol><ol start="6" class="notion-list notion-list-numbered notion-block-976803d0af1a4b8facd8bb9a22308a7e" style="list-style-type:decimal"><li><b>往上走 / 往下掉</b>：带色素的细胞随表皮<b>周转</b>向外迁移；旧的角质层脱落时，一部分色素也跟着离开。</li></ol><div class="notion-text notion-block-f578b675ffed4a57bb943d17c82248b9">旁路也很重要：<b>炎症本身</b>会再推高「下令」与造色素；有些成分被叙述为先压炎症、或干预与纤溶酶相关的信号（例如外用氨甲环酸的常见讲法），再间接影响后面几环。</div><div class="notion-text notion-block-0e2702e08d1a45a3b76711d3a9deb0de">国内监管科普也把功效机制粗归为：抑制生成、阻断转运、还原色素、促进表皮脱落等——你选精华时，买的是「踩在哪一环」，不是广告上的某个百分数。</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-dce1409a61944268aca3cdb88bceaf61" data-id="dce1409a61944268aca3cdb88bceaf61"><span><div id="dce1409a61944268aca3cdb88bceaf61" class="notion-header-anchor"></div><a class="notion-hash-link" href="#dce1409a61944268aca3cdb88bceaf61" title="再形象对照：常见成分类踩在哪一环？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">再形象对照：常见成分类踩在哪一环？</span></span></h4><div class="notion-text notion-block-754fc24b5bb146c5a76f0aceeae67dee">把上图当成地图，成分类大致落在这些「刹车点」（叙述口径，不是保证人人有效）：</div><div class="notion-text notion-block-92727a7c8f4746a19785ca8dd22fbd54">一句话记：</div><ul class="notion-list notion-list-disc notion-block-f39d9443aa2747f9bef4ac38fb4d943c"><li><b>关输入</b>（防晒）挡的是第 1 环持续下令；</li></ul><ul class="notion-list notion-list-disc notion-block-082a753d28c94f029787b0573e8ef8df"><li><b>烟酰胺</b>更常被讲成挡第 4 环「交货」；</li></ul><ul class="notion-list notion-list-disc notion-block-506c7be297474e4ca743e361fa7c66b8"><li><b>维 C / 熊果苷 / 曲酸</b>等更常被讲成挡第 2 环「造色素」；</li></ul><ul class="notion-list notion-list-disc notion-block-1c3c50d83b4c4fd7929e727dfd6279cb"><li><b>维 A、酸类</b>更常被讲成加速第 6 环「往下掉」，但刺激过头会回到第 1 环，再造出新的 PIH（炎症后色沉）。</li></ul><table class="notion-simple-table notion-block-d3d612848c444c4f9c9aad7c2a02ff69"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-6c38a9af359842fe859c472e5657c78b"><td class="" style="width:120px"><div class="notion-simple-table-cell">成分类</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">形象落点</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">起步友好度 / 失败风险</div></td></tr><tr class="notion-simple-table-row notion-block-7bf9fabd1afa4ea9b0d6841525277538"><td class="" style="width:120px"><div class="notion-simple-table-cell">烟酰胺（niacinamide）</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">挡「交货」：转运相关</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">相对常作起步类；仍可能刺激个别皮肤</div></td></tr><tr class="notion-simple-table-row notion-block-bdbf8995d2d74090bd7a1a339d97afc8"><td class="" style="width:120px"><div class="notion-simple-table-cell">维生素 C 类</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">挡「造色素」：抗氧化 / 辅助酪氨酸酶</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">剂型与稳定性差异大；柜面「VC」≠稳定活性</div></td></tr><tr class="notion-simple-table-row notion-block-8570f4016c3d4a7e883e6887971ed0ed"><td class="" style="width:120px"><div class="notion-simple-table-cell">熊果苷（arbutin）</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">挡「造色素」：酪氨酸酶相关</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">欧盟 SCCS（Scientific Committee on Consumer Safety，消费者安全科学委员会）有安全浓度意见；别把广告浓度当疗效</div></td></tr><tr class="notion-simple-table-row notion-block-f90e7a46bbe34185bb6d9f64ef669a50"><td class="" style="width:120px"><div class="notion-simple-table-cell">外用氨甲环酸（tranexamic acid，TXA）</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">偏上游：纤溶酶相关信号叙述</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">外用 ≠ 口服；口服须医疗评估，勿自行美白口服</div></td></tr><tr class="notion-simple-table-row notion-block-c208ea6c84544045a70f3117087ddc3f"><td class="" style="width:120px"><div class="notion-simple-table-cell">壬二酸（azelaic acid）</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">造色素 + 抗炎旁路</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">常作色素/炎症相邻选项类；路径因地区而异</div></td></tr><tr class="notion-simple-table-row notion-block-218735508fcf43f383a6dff273ccee2d"><td class="" style="width:120px"><div class="notion-simple-table-cell">曲酸（kojic acid）</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">挡「造色素」：酪氨酸酶相关</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">刺激风险需留意；细则见下方 Toggle</div></td></tr><tr class="notion-simple-table-row notion-block-08a40514eb5245d1872fecc7579297b7"><td class="" style="width:120px"><div class="notion-simple-table-cell">维 A 类（retinoids，含视黄醇等）</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">加速「往下掉」：周转相邻</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">刺激可诱发 PIH；<b>妊娠期应避免</b></div></td></tr><tr class="notion-simple-table-row notion-block-bc9c66d9a28641b39ddc1c1ad9349660"><td class="" style="width:120px"><div class="notion-simple-table-cell">果酸 / 水杨酸等酸类（AHA/BHA，Alpha-/Beta-Hydroxy Acid）</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">辅助「往下掉」：表皮周转</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">过强刺激 → 屏障损伤 → 新的 PIH</div></td></tr></tbody></table><div class="notion-text notion-block-635e1e6bc03349f6ae35b5d043262fdb">失败模式很短：<b>刺激制造新炎症，新炎症再留下 PIH（炎症后色沉）</b>——于是「越美白越斑」。多酸堆叠、新人礼式强维 A，属于高关系成本玩法，不是礼赠默认路径。</div><details class="notion-toggle notion-block-83f59bbbd694441f83d23f6be1844e76"><summary>曲酸与「浓度营销」：主路径之外要知道的两件事</summary><div><div class="notion-text notion-block-be9a299c6cab42c28b57e6b59cf3fbf6">曲酸常出现在美白配方讨论里。国内监管科普曾转述欧盟消费者安全科学委员会（SCCS）<b>初步</b>意见：约 <b>1%</b> 最大浓度「将不再被认为是安全的」（并提及内分泌相关关注）。其后 SCCS <b>最终意见</b>则认为：作为皮肤美白剂使用时，曲酸在最高 <b>1%</b> 浓度下可视为安全，但仍提示屏障受损/剥脱等场景下吸收可能升高。</div><div class="notion-text notion-block-78b9f61dc7ab4000b521d2e1107e3192">因此本文不把「1%」写成人人可安心照抄的柜面上限，也不把它写成起步首选叙事——个体刺激差异大，主路径仍优先更常作为起步讨论的成分类。</div><div class="notion-text notion-block-3381856fe60041eb938dc674508d9196">广告上的活性物百分数，说明的是配方宣称，<b>不是疗效证据</b>。浓度可以与刺激相关，却不能拿来证明「这瓶一定更白」。挑选时看成分类匹配、耐受和防晒，而不是比谁数字更大。</div></div></details><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-4b160b0002dd454dbc81b72f0dee5c32" data-id="4b160b0002dd454dbc81b72f0dee5c32"><span><div id="4b160b0002dd454dbc81b72f0dee5c32" class="notion-header-anchor"></div><a class="notion-hash-link" href="#4b160b0002dd454dbc81b72f0dee5c32" title="在中国买时，标签上该看什么？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">在中国买时，标签上该看什么？</span></span></h3><div class="notion-text notion-block-2fe3874cd7fe41d3b4ddd27c1834b083">成分类解决「可能打断哪一步」；标签与注册解决另一类失败：<b>灰市违禁原料带来的健康风险</b>，以及「宣称祛斑美白却无相应注册」的合规红灯。</div><div class="notion-text notion-block-0f8a2ad3a6b347b99a490e54e74e2699">全成分表通常按含量<b>降序</b>排列；含量 <b>≤0.1%</b> 的其他微量成分，法规语境下可合并列出——你仍应通读，而不是只盯住包装正面的大字。</div><div class="notion-callout notion-red_background_co notion-block-fded4874b95f40aa8173d502f56f56ab"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="⚠️">⚠️</span></div><div class="notion-callout-text"><div class="notion-text notion-block-3d238b2c7ff44d89b42653dc19650ea5"><b>氢醌（hydroquinone）</b>：中国化妆品禁用原料语境（国家药监局更新禁用原料目录）；美国皮肤科公共教育亦指出氢醌已不再作为非处方药（Over-The-Counter，OTC，柜台可直接购买的药品路径）销售，处方须医生。灰市「强效美白」常踩这里。</div><div class="notion-text notion-block-720c58232fae482e92de0abbc3b2bbb6"><b>汞</b>：WHO 将含汞皮肤美白产品列为全球健康危害；《水俣公约》化妆品汞限值语境为 <b>1 ppm</b>，非法产品仍在流通。远离来源不明的美白膏/霜。</div><div class="notion-text notion-block-87591789b46b4757a4ae24684ae826d4"><b>中国「祛斑美白」宣称</b>：属<b>特殊化妆品</b>，须注册。常见标识形态包括「国妆特字G…」「国妆特进字J…」。并区分「仅具物理遮盖」与功效宣称；警惕「快速美白」「七日白」「医学美白」等话术。用官方渠道核对注册，不要只信包装口号。</div></div></div><details class="notion-toggle notion-block-378f1f64555040538d6c826890a53b9c"><summary>国妆特字怎么查（步骤级，可跳过）</summary><div><div class="notion-text notion-block-16fbff962285475b866d9ff35d5199d5">先看包装与说明书：是否明确宣称祛斑美白，以及是否印有特殊化妆品注册标识（如国妆特字 / 国妆特进字）。</div><div class="notion-text notion-block-138a980f6e05486dbdfd943fe59f3741">再到国家药品监督管理局相关官方网站或指定查询 APP，用产品名称或注册证号核对：注册人、产品名称、批准状态是否一致。</div><div class="notion-text notion-block-1f14fd948f6642e6b0153f726b663a36">若大打祛斑美白却查无对应特殊化妆品注册，或来源渠道可疑，按高风险处理：不买、不代购、不当礼物。</div><div class="notion-text notion-block-e99895e899a745a9ab41ccf189ce2721">注册信息说明的是监管路径，<b>不是疗效证书</b>；特证产品仍要配合防晒与耐受。</div></div></details><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-c4fb6931fe634d65ac71d289d654bd8b" data-id="c4fb6931fe634d65ac71d289d654bd8b"><span><div id="c4fb6931fe634d65ac71d289d654bd8b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#c4fb6931fe634d65ac71d289d654bd8b" title="怎么挑：一条可以照着做的决策链"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">怎么挑：一条可以照着做的决策链</span></span></h3><div class="notion-text notion-block-65433148be2942bc89af8188949a9f16">把前面串成可执行检查，而不是再开一份新榜单。</div><div class="notion-to-do notion-block-66b2df6b115b404c977dea9b7be34954"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">已问清目标更像痘印 / 炎症后色沉（PIH）、黄褐斑样，还是整体暗沉</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-75175d2169e24132892f7860832912bb"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">已确认是否备孕/怀孕（有则避开维 A 与氢醌）；若正在哺乳，先咨询医生再决定活性成分</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-0aad4d7c6c814dd2967cbcc3973f9f53"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">已确认已知过敏、香精敏感或屏障脆弱史</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-0e0e4de132fa4674988e010261213a34"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">成分类匹配粗分，且优先<b>单一活性起步</b>，避免多酸堆叠</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-b121f460b6964d1980fc3d923a98d2ab"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">计划做斑贴试用，而不是全脸首日拉满</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-7a182aee2055416194a5dc9b6240d143"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">日防晒 <b>SPF 30+</b>（防晒系数）已纳入日常（黄褐斑样考虑可见光/有色防晒讨论）</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-6af4fc18bc174293b95f041d88abe36c"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">预期按<b>月</b>观察，不接受「七日白」话术</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-e00a0ea76af34c6084e29ebbfcafcf72"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">宣称祛斑美白时已核对中国特殊化妆品注册；已通读全成分</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-1ca43c2eb78f4258951453d7c16374ce"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">拒绝来源不明、疑似氢醌/含汞美白产品</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-e1e08cc7bcc54232a8764931221be9db"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">无效、加重或边界不清时，升级到皮肤科，而不是继续加刺激</div></div><div class="notion-to-do-children"></div></div><div class="notion-text notion-block-665a3f703d5a4a70ada5164fdf93f1aa">过程推荐降低踩雷概率，<b>不保证</b>某一类一定有效。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-a990930072cd4fd4a5851d2d5ba51029" data-id="a990930072cd4fd4a5851d2d5ba51029"><span><div id="a990930072cd4fd4a5851d2d5ba51029" class="notion-header-anchor"></div><a class="notion-hash-link" href="#a990930072cd4fd4a5851d2d5ba51029" title="当礼物送时，怎样选才不像「踩雷瓶」？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">当礼物送时，怎样选才不像「踩雷瓶」？</span></span></h3><div class="notion-text notion-block-caf09c17bb334e84abdc1613f926da3b">不能替她做斑贴时，最好的礼物常常不是「最火那瓶」，而是<b>你问过、你懂边界</b>。</div><div class="notion-text notion-block-dc5943223b2948ec94ade601e7b881a6">先问（比下单重要）：</div><ul class="notion-list notion-list-disc notion-block-877a2b47725a47ac95b6bc55e17d9020"><li>目标更像痘印、斑点，还是整体暗沉？</li></ul><ul class="notion-list notion-list-disc notion-block-32ab4ee2f51c48f58d0ccbfede29db33"><li>是否备孕或怀孕？若正在哺乳，是否已问过医生？</li></ul><ul class="notion-list notion-list-disc notion-block-6ce9acab9a254db2b15195ccdadf7ed0"><li>已知过敏、香精敏感、屏障是否脆弱？</li></ul><ul class="notion-list notion-list-disc notion-block-64974f45892349499f39bbaf3031b9b5"><li>能否接受日常防晒？偏好无香还是可接受淡香？</li></ul><ul class="notion-list notion-list-disc notion-block-3e0d72e95c0841679da4c525b40971d1"><li>愿不愿意一起逛柜做斑贴，而不是盲盒惊喜？</li></ul><div class="notion-text notion-block-1bd0f711ce804945bf48266860af6699">可接受者，是<b>类</b>而不是 SKU：倾向无香精、<b>单一活性起步类</b>（例如烟酰胺类常被作为相对友好的讨论起点）+ 基础保湿 + <b>SPF 30+</b>（防晒系数）防晒，组成可退换的「起步套装」叙事。仪式感来自你把防晒和时间尺度写进短卡，而不是排名第一。</div><div class="notion-text notion-block-ad912a6d2032420b8420c794025a219b">明确不要送：强酸剥脱、高浓度多酸堆叠、强维 A「新人礼」、七日神效话术瓶、来源不明的祛斑美白、以及口服美白药/针当节日礼物。</div><div class="notion-text notion-block-0adabbcd08be4629940b3a6298e66874">不确定时，默认策略是<b>一起选</b>，或礼品卡 + 你整理的成分类短名单——正文到此为止，仍然<b>零商业单品点名</b>。</div><hr class="notion-hr notion-block-40351b55f97a4f738e6b7f639e6064ea"/><div class="notion-text notion-block-f15be0fb3dce490499c8cdcc64f5e747">阳光、炎症和激素把黑色素往上推，外观才出现暗沉与斑点；精华最多打断合成、转运或周转中的一步，<b>关不住输入（UV）就会反弹</b>。过强刺激制造新的 PIH（炎症后色沉）；合规标签与特证降低的是汞、氢醌一类系统性风险，不是替你保证美白速度。挑选是一条「诉求 → 粗分 → 成分类 → 斑贴 → 防晒 → 必要时就医」的过程——不是再追一份榜单。</div><hr class="notion-hr notion-block-b5c234988d3f45eea63d3be5272f1897"/><div class="notion-text notion-block-aa9e7b69e03542219121130fdde9afef"><b>参考来源</b>（Evidence rechecked: 2026-08-16）</div><ul class="notion-list notion-list-disc notion-block-41c11ba398244301943f7536e86f999f"><li><a class="notion-link" href="https://www.aad.org/public/diseases/a-z/melasma-treatment" target="_blank" rel="noopener noreferrer">AAD：黄褐斑治疗与护理</a></li></ul><ul class="notion-list notion-list-disc notion-block-1e6ce22d25534ec3a3245af3eb312481"><li><a class="notion-link" href="https://www.aad.org/public/everyday-care/skin-care-secrets/routine/fade-dark-spots" target="_blank" rel="noopener noreferrer">AAD：淡化暗沉斑点</a></li></ul><ul class="notion-list notion-list-disc notion-block-9f261e7b942843f1b2656a8b02d387fa"><li><a class="notion-link" href="https://www.aad.org/public/everyday-care/skin-care-secrets/routine/pregnancy-skin-care" target="_blank" rel="noopener noreferrer">AAD：妊娠期护肤注意</a></li></ul><ul class="notion-list notion-list-disc notion-block-836c5df11a6d4645af7b5a11754ae9c4"><li><a class="notion-link" href="https://www.who.int/initiatives/elimination-of-mercury-containing-skin-lightening-products" target="_blank" rel="noopener noreferrer">WHO：消除含汞皮肤美白产品倡议</a></li></ul><ul class="notion-list notion-list-disc notion-block-c0fae0d360f24b72b31663cc7cfe7fec"><li><a class="notion-link" href="https://www.who.int/news/item/14-02-2023-countries-unite-to-remove-mercury-from-hazardous-skin-lightening-products" target="_blank" rel="noopener noreferrer">WHO：各国联合减少危险含汞美白产品（2023-02-14）</a></li></ul><ul class="notion-list notion-list-disc notion-block-2356376855564da3aa7bf918660ecdda"><li><a class="notion-link" href="https://www.ccfdie.org/cn/hzpkpxc/webinfo/2022/03/1648288894121169.htm" target="_blank" rel="noopener noreferrer">中国食品药品国际交流中心：浅谈美白化妆品与美白剂</a></li></ul><ul class="notion-list notion-list-disc notion-block-8bd889cea5074401bf5423b25b9d60b2"><li><a class="notion-link" href="https://xzfg.moj.gov.cn/front/law/detail?LawID=451" target="_blank" rel="noopener noreferrer">《化妆品监督管理条例》</a></li></ul><ul class="notion-list notion-list-disc notion-block-ac2de3def7104853a0cb816b5f636029"><li><a class="notion-link" href="https://tid.gov.hk/en/tradecircular/files/2021/ci2021371a.pdf" target="_blank" rel="noopener noreferrer">国家药监局关于更新化妆品禁用原料目录的公告（2021 年第 74 号）文本转载</a></li></ul><ul class="notion-list notion-list-disc notion-block-515081f5147346ee835567e557174b5f"><li><a class="notion-link" href="https://health.ec.europa.eu/publications/safety-alpha-arbutin-and-beta-arbutin-cosmetic-products_en" target="_blank" rel="noopener noreferrer">SCCS：α-/β-熊果苷在化妆品中的安全性意见</a></li></ul><ul class="notion-list notion-list-disc notion-block-99eaacd81aa14f01bfbd02c8d58fbaf8"><li><a class="notion-link" href="https://health.ec.europa.eu/publications/kojic-acid_en" target="_blank" rel="noopener noreferrer">SCCS：曲酸（kojic acid）安全性意见</a></li></ul></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DeepSeek V4 Pro、Grok 4.6、Claude 与 ChatGPT：能力、价格和场景怎么选？]]></title>
            <link>https://ximouzhao.com/article/choose-deepseek-v4-pro-or-grok-4-6</link>
            <guid>https://ximouzhao.com/article/choose-deepseek-v4-pro-or-grok-4-6</guid>
            <pubDate>Thu, 13 Aug 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[比较四个模型及其聊天产品，帮助读者按使用形态、任务、完整成本与工具需求确定试用顺序。]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-3bb4b0ac588b81d18b72f0aaeeacf458"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-callout notion-yellow_background_co notion-block-e359df8a8a984a8d88d105405f413ee8"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="⚠️">⚠️</span></div><div class="notion-callout-text"><div class="notion-text notion-block-67dca54c73e54dcead107bea29b89ad6">你可能同时看到两种价格：API 每 100 万词元几美元，聊天产品每月几十美元。它们不能直接比较。<b>API token 价格 ≠ 聊天订阅价格或可用额度</b>：前者按程序调用量计费，后者购买的是网页或 App 里的模型、工具、界面和动态额度。</div></div></div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-16ab9c00aa2744babb1f587fbcfbe9cf" data-id="16ab9c00aa2744babb1f587fbcfbe9cf"><span><div id="16ab9c00aa2744babb1f587fbcfbe9cf" class="notion-header-anchor"></div><a class="notion-hash-link" href="#16ab9c00aa2744babb1f587fbcfbe9cf" title="先别比模型：你买的是聊天产品还是 API？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">先别比模型：你买的是聊天产品还是 API？</span></span></h3><div class="notion-text notion-block-cccd57026a2748129b157a65adf92b9f">假设你既想给自己的项目接入模型，又在考虑购买个人订阅。虽然两边都写着 DeepSeek、Grok、Claude 或 ChatGPT，实际买到的东西不同。</div><div class="notion-text notion-block-7a39eec6dac04e98aad0ecfa5af27538"><b>聊天产品</b>是完整的网页或 App，包含模型路由、文件上传、联网搜索、语音等工具和产品额度。<b>应用程序接口（Application Programming Interface，API）模型</b>则由程序通过模型标识符（model ID）调用，按实际输入、输出、缓存和工具用量计费。</div><div class="notion-text notion-block-d8c36dce18c442cd86e09e4fa882cc60">因此，本文分成两条路径：</div><div class="notion-text notion-block-719fb10744f746ec9c9d33c0dc3c48a9">两条路径最后仍回到同一个问题：模型是否能在你的场景里稳定完成任务，而不是它在一张总榜上排第几。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-369c5a99181948f0a3cc85915c1ed810" data-id="369c5a99181948f0a3cc85915c1ed810"><span><div id="369c5a99181948f0a3cc85915c1ed810" class="notion-header-anchor"></div><a class="notion-hash-link" href="#369c5a99181948f0a3cc85915c1ed810" title="先写下任务：什么才算“更适合你”？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">先写下任务：什么才算“更适合你”？</span></span></h3><div class="notion-text notion-block-ae4f7f43e44c4c02b873d3695e189875"><b>任务成功率</b>是模型在预先写明的验收标准下，完成任务的比例。没有验收标准，“回答看起来不错”很容易变成主观印象。</div><div class="notion-text notion-block-7b697b0052834b9b9f32aa37d5df7787"><b>完整任务成本</b>也不只是 token 账单。它还包括推理、工具调用、失败重试、等待时间以及人工纠错。如果一个便宜模型需要三次重试，另一个较贵模型一次通过，后者的完整成本可能更低。</div><div class="notion-text notion-block-3ecc6fce3e87400b93ee619f5510f00b">比较前先写下：</div><div class="notion-to-do notion-block-f73bcc5cbd5a41fc828c4cdf7619aa95"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">一组来自真实工作的输入，而不是临时编写的演示题。</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-149a2b421f3241dda3940a0e81a435b7"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">可判定通过或失败的结果，例如测试通过、引用准确或字段完整。</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-be47a192d95f4e8d8f78326aa6738349"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">必须具备的模态、工具和上下文。模态是文本、图片等输入类型；上下文是一次请求能同时处理的材料范围。</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-4f73ad79968c43af80b72152b5df3d52"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">每天的任务量、可接受等待时间和预算。</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-4d9abfcba5744fdf97425487c6d05b9c"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">失败后由谁修正，以及必须保留什么回退方案。</div></div><div class="notion-to-do-children"></div></div><div class="notion-text notion-block-6662573c79444f57ae9a9cd43b236a7e">本文用八类常见场景贯穿两条路径：日常问答与写作、编程与终端任务、AI 智能体（AI Agent，模型多轮调用工具并根据结果继续行动的系统）、长文档、图片理解、中文任务、高量批处理和高价值复杂任务。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-2446e87b4e6a469190e183fd0d6cea78" data-id="2446e87b4e6a469190e183fd0d6cea78"><span><div id="2446e87b4e6a469190e183fd0d6cea78" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2446e87b4e6a469190e183fd0d6cea78" title="四个模型的能力差距，哪些值得相信？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">四个模型的能力差距，哪些值得相信？</span></span></h3><div class="notion-text notion-block-6ccab319023544c1ab273b62393a17bb">基准测试（Benchmark）是在固定任务集和运行规则下比较模型的评测。推理努力档（reasoning effort）则控制模型为回答投入多少计算。模型版本、努力档和运行框架不同，分数就不能当成完全公平的单变量比较。</div><div class="notion-text notion-block-0bee5aecdcc540cdba68fa6431c485a1">截至 2026 年 8 月 13 日，三个较有用的独立信号如下：</div><table class="notion-simple-table notion-block-23c42dc9433044dba7153005cd9a0743"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-ecbed28add764b9b9bd3e5089e5b55d2"><td class="" style="width:120px"><div class="notion-simple-table-cell">独立证据</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">当前结果</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">适合回答的问题</div></td></tr><tr class="notion-simple-table-row notion-block-0bb999b4f3394563b07700b99d5e3dee"><td class="" style="width:120px"><div class="notion-simple-table-cell">Artificial Analysis Intelligence Index（AA Index）v4.1.1</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Claude Opus 5 max 63；GPT-5.6 Sol max 61；Grok 4.6 high 61；DeepSeek 0813 max 53</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">综合能力是否值得进入候选集</div></td></tr><tr class="notion-simple-table-row notion-block-15441c99a5db41a7a5ca1d27fe2f73bf"><td class="" style="width:120px"><div class="notion-simple-table-cell">Terminal-Bench v2.1</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">GPT-5.6 Sol（xhigh）89.5%；Claude Opus 5（Adaptive Reasoning，max）89.1%；Grok 4.6（high）88.4%；DeepSeek V4 Pro 0813 暂无同一 Terminal-Bench v2.1 / Terminus 2 口径结果</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">终端智能体和编程任务的试用顺序</div></td></tr><tr class="notion-simple-table-row notion-block-e027283ac0ad4ddbbd3fb7068e9b6a23"><td class="" style="width:120px"><div class="notion-simple-table-cell">中文人类偏好榜</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Claude high 1575±17；GPT xhigh 1543±19；Grok high 1535±34，且为 preliminary；DeepSeek 0813 票数证据不足</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">中文开放式回答的初步偏好信号</div></td></tr></tbody></table><div class="notion-callout notion-blue_background_co notion-block-042da873186546b1a281c8e8e4f9fa4f"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="🧭">🧭</span></div><div class="notion-callout-text"><div class="notion-text notion-block-b9c99edcb78c4dac941cd24968c7274a">Benchmark ≠ IQ。分数描述的是某个精确版本、努力档和评测框架下的结果，不是通用智商，也不能证明它在你的任务里必胜。尤其是中文榜，置信区间、票数和版本证据都不支持宣布一个永久赢家。</div></div></div><div class="notion-text notion-block-56c6aa3f3bec456caa9f5a0e8206870d">厂商能力页仍然有用，但只能按厂商声明理解：Anthropic 将 Claude Opus 5 定位于复杂智能体编程和企业工作；OpenAI 将 GPT-5.6 Sol 定位于复杂专业工作并提供丰富的托管工具；xAI 将 Grok 4.6 定位于编程、智能体和知识工作。它们能说明产品设计方向，不能代替独立测试。</div><details class="notion-toggle notion-block-85c5b10943164b028749f091c4a253f7"><summary>为什么这些基准不能直接排成通用名次？</summary><div><div class="notion-text notion-block-101a2b0cca494e8e947ad4327ea10a3e">AA 综合指数包含多个任务，但各模型使用的推理努力档不同。Terminal-Bench 使用指定智能体框架和终端环境，不能覆盖普通写作、视觉或你的内部工具。中文竞技场依赖人类偏好投票，票数、题材和置信区间都会影响排名。正确用法是按场景挑选候选，再用真实任务验证。</div></div></details><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-a910d617227a4740b80282926fff73dc" data-id="a910d617227a4740b80282926fff73dc"><span><div id="a910d617227a4740b80282926fff73dc" class="notion-header-anchor"></div><a class="notion-hash-link" href="#a910d617227a4740b80282926fff73dc" title="如果你选 API：同一任务的总成本和硬约束怎么比？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">如果你选 API：同一任务的总成本和硬约束怎么比？</span></span></h3><div class="notion-text notion-block-438b1587d4d04683a9f03c0778a77e12">API 路径应使用精确模型 ID：<code class="notion-inline-code">deepseek-v4-pro</code>、<code class="notion-inline-code">grok-4.6</code>、<code class="notion-inline-code">claude-opus-5</code> 和 <code class="notion-inline-code">gpt-5.6-sol</code>。不要把聊天产品名称、网页端自动路由或相近版本的成绩混进来。</div><div class="notion-text notion-block-879b6380b8c045358af427441cff6d7a">先看决定任务能否执行的硬约束：</div><table class="notion-simple-table notion-block-9e423d13370840639091d2a42c0bb030"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-7fe796600c37463f8a5cab5f61dbc3c5"><td class="" style="width:120px"><div class="notion-simple-table-cell">API 模型</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">上下文 / 最大输出</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">输入；工具执行边界</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">推理控制</div></td></tr><tr class="notion-simple-table-row notion-block-49d8829e95864faebc03d1b95e267442"><td class="" style="width:120px"><div class="notion-simple-table-cell">DeepSeek V4 Pro 0813</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">1M / 384K</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">文本；函数或工具调用由接入方执行</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">默认思考，可切换非思考</div></td></tr><tr class="notion-simple-table-row notion-block-3ba1fb9cb79a4149b62104fc9d40f9d5"><td class="" style="width:120px"><div class="notion-simple-table-cell">Grok 4.6</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">500K / 受上下文边界约束</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">文本、图片；Web/X 搜索与代码执行由 xAI 托管，函数调用由接入方执行</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">low 至 xhigh</div></td></tr><tr class="notion-simple-table-row notion-block-4f5645e2a57e48009878be0e45ecddcb"><td class="" style="width:120px"><div class="notion-simple-table-cell">Claude Opus 5</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">1M / 128K</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">文本、图片；Web/Fetch/代码执行等由 Anthropic 托管，Bash、电脑操作等由接入方执行</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">默认思考，多档 effort</div></td></tr><tr class="notion-simple-table-row notion-block-153a00ea492d4ee88bc0d643760cbc99"><td class="" style="width:120px"><div class="notion-simple-table-cell">GPT-5.6 Sol</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">1.05M / 128K</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">文本、图片；搜索、图片生成、代码和托管命令行环境（Shell）；电脑操作、模型上下文协议（Model Context Protocol，MCP）等按工具文档核对执行位置</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">none 至 max</div></td></tr></tbody></table><div class="notion-text notion-block-a68bec7722f14ed4adf0eb6a2f265977">以下价格均按每 100 万词元计算。DeepSeek 官方以人民币计价，另外三家以美元计价，两种货币不能直接比较；应按实际结算汇率换算。词元（token）是模型处理文字时使用的切片单位；缓存输入是重复前缀命中供应商缓存后的低价输入。</div><table class="notion-simple-table notion-block-2fe4c0d36997484cabbd79056bf529f6"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-6c619023b86f4757a8a931738aaaf452"><td class="" style="width:120px"><div class="notion-simple-table-cell">模型</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">未缓存输入 / 缓存 / 输出</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">长请求规则</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">50K 输入 + 2K 输出</div></td></tr><tr class="notion-simple-table-row notion-block-72a96d55e2ed4348b6c95d7c19fa094b"><td class="" style="width:120px"><div class="notion-simple-table-cell">DeepSeek</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">当前：¥3 / ¥0.025 / ¥6；8 月 17 日起谷时：¥4.5 / ¥0.15 / ¥13.5；峰时：¥9 / ¥0.30 / ¥27</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">8 月 17 日起采用峰谷价；当前未列长上下文附加档</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">当前 ¥0.162；新价谷时 ¥0.252、峰时 ¥0.504</div></td></tr><tr class="notion-simple-table-row notion-block-ec5dd8772c4748f39e0d3e828d5591b2"><td class="" style="width:120px"><div class="notion-simple-table-cell">Grok</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">$2 / $0.50 / $6</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">提示达到 200K 后整单变为 $4 / $1 / $12</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">$0.112</div></td></tr><tr class="notion-simple-table-row notion-block-88d10947a6d84ffba8d2df584fc0a9f9"><td class="" style="width:120px"><div class="notion-simple-table-cell">Claude</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">$5 / $0.50 / $25</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">1M 窗口维持标准价</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">$0.30</div></td></tr><tr class="notion-simple-table-row notion-block-922d79da98e3414a9621586d84683807"><td class="" style="width:120px"><div class="notion-simple-table-cell">GPT</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">$5 / $0.50 / $30</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">输入超过 272K 后，整单输入 2 倍、输出 1.5 倍</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">$0.31</div></td></tr></tbody></table><div class="notion-text notion-block-e7fa176b3ef04acb84d159dd3ff4271d">这个标准样例假设 50K 未缓存输入和 2K 输出，不含推理、工具、重试与缓存写入。DeepSeek 一行是人民币，其余三行是美元，需按实际结算汇率换算；即使单次调用便宜，也不能证明它完成同一业务结果的成本最低。</div><div class="notion-callout notion-yellow_background_co notion-block-90d1ef023f2a456cbadbdeae4fb09e27"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="⏱️">⏱️</span></div><div class="notion-callout-text"><div class="notion-text notion-block-dc01af623bdc4dd9b3061feac63f9ad9">DeepSeek 新峰谷价将于北京时间 2026 年 8 月 17 日 00:00 生效：9:00–12:00、14:00–18:00 为高峰，其余时段半价。本文发布时仍适用旧价；上线任务必须按实际调用日期和时段核算。Grok 的 200K、GPT 的 272K 还是整单价格边界。</div></div></div><details class="notion-toggle notion-block-22e7edc3704d4b7a8163952b330db098"><summary>缓存和完整任务成本怎样计算？</summary><div><div class="notion-text notion-block-0566b084546f4c1f977999cf5c858d47">无缓存演示成本为：<code class="notion-inline-code">输入词元 ÷ 1,000,000 × 输入单价 + 输出词元 ÷ 1,000,000 × 输出单价</code>。</div><div class="notion-text notion-block-b326b6fe49ab41d1a427549314acffe6">真实成本还要加上缓存写入、推理词元、服务端工具、失败重试和人工修正。应比较 <code class="notion-inline-code">完成任务的总支出 ÷ 成功任务数</code>，并同时记录等待时间。只有请求实际命中缓存时，缓存读取单价才有意义。</div></div></details><details class="notion-toggle notion-block-5365a9cabdef416e9fbda511d956d95e"><summary>开放权重和自己部署什么时候才影响选择？</summary><div><div class="notion-text notion-block-c6b94e205305406fb4a6120d2f7b2487">只有当数据边界、离线运行或避免供应商锁定是硬约束时，开放权重才应成为前置条件。可下载权重不等于容易或便宜地部署，也不能自动证明它与某个 API 快照完全一致。</div><div class="notion-text notion-block-e43e267f2c8c4dde81abb1ddca21474e">目前不应把已有的 DeepSeek 可下载检查点直接视为 <code class="notion-inline-code">DeepSeek-V4-Pro-0813</code> API 的同一版本。Claude、Grok 与 GPT 的上述 API 模型也没有提供可自行部署的权重。若必须自建，应另做检查点、许可证、硬件和推理成本评估，而不是继续比较这四个托管 API。</div></div></details><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-2d057f5bfd8847348d47838bbb4f844b" data-id="2d057f5bfd8847348d47838bbb4f844b"><span><div id="2d057f5bfd8847348d47838bbb4f844b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2d057f5bfd8847348d47838bbb4f844b" title="如果你买订阅：该比较产品里的什么？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">如果你买订阅：该比较产品里的什么？</span></span></h3><div class="notion-text notion-block-590a87c2460a4852b00603e3786b4a79">聊天订阅购买的是产品体验，不是一个固定数量的 API token。你真正需要比较的是：常用模型能否选择、文件与联网工具是否可用、额度如何共享，以及达到限制后工作是否会中断。</div><table class="notion-simple-table notion-block-412f49d0b12b440088ef9bf20d3b1ed0"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-3d3dfbb3268d41cc8f27d43a1ee2becc"><td class="" style="width:120px"><div class="notion-simple-table-cell">聊天产品</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">个人价格</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">已确认的产品能力</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">需要保留的不确定性</div></td></tr><tr class="notion-simple-table-row notion-block-18841d30f5674c1b824b4f4db962f8b8"><td class="" style="width:120px"><div class="notion-simple-table-cell">DeepSeek</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">网页与 App 免费</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Web 搜索、DeepThink、文件上传</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">精确模型路由和固定额度未公开</div></td></tr><tr class="notion-simple-table-row notion-block-3031c871a93546998bb67ad2c997e2a1"><td class="" style="width:120px"><div class="notion-simple-table-cell">Grok</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">免费开始；SuperGrok 付费</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">聊天、文件、图片/视频、语音、连接器</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">当前消费价格及 Grok 4.6 的精确可用性未稳定披露</div></td></tr><tr class="notion-simple-table-row notion-block-1c08db18451d4b2baacad274b487715f"><td class="" style="width:120px"><div class="notion-simple-table-cell">Claude</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Free $0；Pro $20/月或 $200/年；Max $100 起</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">网页与多端 App、搜索、文件、代码执行、Projects、连接器</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">模型访问和动态限制受套餐、任务与使用情况影响</div></td></tr><tr class="notion-simple-table-row notion-block-31ee74870e574511a84ad6fcc371416d"><td class="" style="width:120px"><div class="notion-simple-table-cell">ChatGPT</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Free $0；Go 美国 $8；Plus $20；Pro 5x $100 或 20x $200</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Web、文件、图片、语音、分析、Projects、Codex</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">工具和模型配额会变化</div></td></tr></tbody></table><div class="notion-text notion-block-4856c65b1fee45f6b8f2347477b84bf6">ChatGPT 当前给 Free 和 Go 用户提供 GPT-5.6 Luna；Plus 提供 GPT-5.6 Sol Medium 与 High；Pro 再增加 Extra High 和 Sol Pro。这里描述的是 ChatGPT 产品内访问，不代表订阅包含同名 API 的调用额度。</div><div class="notion-text notion-block-ad7ddbf0c7fd4a3d9b26764cd195c645">Claude Max 的 5x 或 20x、ChatGPT Pro 的 5x 或 20x，以及 SuperGrok 的共享周额度，都是相对产品基准的用量表达，不是固定消息数。长对话、文件、代码任务和高推理档可能消耗得更快。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-f133f7fc234042b7815c9e260d8988b9" data-id="f133f7fc234042b7815c9e260d8988b9"><span><div id="f133f7fc234042b7815c9e260d8988b9" class="notion-header-anchor"></div><a class="notion-hash-link" href="#f133f7fc234042b7815c9e260d8988b9" title="八类场景里，谁更值得先试？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">八类场景里，谁更值得先试？</span></span></h3><div class="notion-text notion-block-869e56f303264b66b44b8b3baed0a303">下面不是冠军榜，而是试用顺序。先排除缺少必要输入、工具或预算条件的候选，再让剩余模型处理同一批样例。</div><div class="notion-text notion-block-c90ee0fcc3994d60a7f7f64f0a87d74c"><b>API 路径</b></div><table class="notion-simple-table notion-block-f940afa28a234143b5fab94475ebb118"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-21d4edb6eeff47f38514820caa6e2d21"><td class="" style="width:120px"><div class="notion-simple-table-cell">场景</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">优先试用</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">主要原因或边界</div></td></tr><tr class="notion-simple-table-row notion-block-ac5bb0babdbf4d5c921924c17cf94d77"><td class="" style="width:120px"><div class="notion-simple-table-cell">日常问答与写作</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">四者并列盲测；若预算或吞吐是硬约束，先试 DeepSeek</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">写作顺序应由文风、事实可靠性和一次通过率决定；DeepSeek 只在成本约束成立时前置</div></td></tr><tr class="notion-simple-table-row notion-block-b369006831184192b6a2cee1440b3e32"><td class="" style="width:120px"><div class="notion-simple-table-cell">编程与终端任务</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">GPT、Claude、Grok</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">独立 Terminal-Bench 证据接近；DeepSeek 0813 精确版本证据较少</div></td></tr><tr class="notion-simple-table-row notion-block-e756f340625342a88b8728fa9661b2c5"><td class="" style="width:120px"><div class="notion-simple-table-cell">AI Agent 与工具链</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">GPT、Claude、Grok</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">三者都有更直接的终端或智能体证据；先按所需工具的执行位置、接入成本和失败恢复能力筛选</div></td></tr><tr class="notion-simple-table-row notion-block-51afcc560610450195ad76bb73304b0a"><td class="" style="width:120px"><div class="notion-simple-table-cell">长文档</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">DeepSeek、Claude、GPT；再试 Grok</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">前三者约 1M 上下文；注意 GPT 与 Grok 的整单涨价边界</div></td></tr><tr class="notion-simple-table-row notion-block-b7818df554694101ac978806256168be"><td class="" style="width:120px"><div class="notion-simple-table-cell">图片理解</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">GPT、Claude、Grok</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">支持原生图片输入；DeepSeek 该 API 为文本输入</div></td></tr><tr class="notion-simple-table-row notion-block-41a5eb0aa7194148b77a64b688318342"><td class="" style="width:120px"><div class="notion-simple-table-cell">中文任务</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">四者盲测</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">当前证据不支持“DeepSeek 自动最好”或任何通用中文冠军</div></td></tr><tr class="notion-simple-table-row notion-block-2424b2383a964832aaf3972916ba9cd3"><td class="" style="width:120px"><div class="notion-simple-table-cell">高量批处理</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">DeepSeek</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">按实际结算汇率比较；8 月 17 日后还要把调用时段、失败率和输出长度计入总成本</div></td></tr><tr class="notion-simple-table-row notion-block-beff01696b084604a4791b89a3ca8525"><td class="" style="width:120px"><div class="notion-simple-table-cell">高价值复杂任务</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Claude、GPT、Grok 并列试</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">前沿综合与智能体证据较强；重点看一次通过率和人工纠错</div></td></tr></tbody></table><div class="notion-text notion-block-f63f7bf88d1e4112a83690492b55fda6"><b>聊天产品路径</b></div><table class="notion-simple-table notion-block-3020a760d90c44d58a3565eb9aa161f2"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-a4e271b025bc464685203d6c65349b74"><td class="" style="width:120px"><div class="notion-simple-table-cell">场景</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">优先试用</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">主要原因或边界</div></td></tr><tr class="notion-simple-table-row notion-block-5d3d784668784f6e98658c98662398f8"><td class="" style="width:120px"><div class="notion-simple-table-cell">日常问答与写作</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">先用已有免费入口</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">DeepSeek、Grok、Claude、ChatGPT 均可低成本试；按文风和工具选择</div></td></tr><tr class="notion-simple-table-row notion-block-1d1a1da9636f4c8fa0554b12c3729eec"><td class="" style="width:120px"><div class="notion-simple-table-cell">编程与终端任务</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Claude、ChatGPT 与账号可用的 Grok Build 同批实测</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Claude Code、Codex 与 Grok Build 属于不同产品入口；应用同一仓库任务实测，不能仅凭功能清单判断谁更完整</div></td></tr><tr class="notion-simple-table-row notion-block-5c2c1af554f44bc4a90dd4df5bb82312"><td class="" style="width:120px"><div class="notion-simple-table-cell">AI Agent 与工具链</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">ChatGPT、Claude、Grok</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">比较 Codex、连接器、Projects 和共享额度，不把 API 能力自动映射过来</div></td></tr><tr class="notion-simple-table-row notion-block-1bef3a0e505e4c99891307d5eb916b13"><td class="" style="width:120px"><div class="notion-simple-table-cell">长文档</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Claude、ChatGPT、Grok；同时试 DeepSeek 文件上传</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">用真实文件检查遗漏和引用；产品限制不等于 API 上下文上限</div></td></tr><tr class="notion-simple-table-row notion-block-ec2b27dc1e2d445db024464195afe4e7"><td class="" style="width:120px"><div class="notion-simple-table-cell">图片理解</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">ChatGPT、Claude、Grok</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">产品明确提供视觉或图片工作流；DeepSeek 官方证据仅确认文件上传与文本提取</div></td></tr><tr class="notion-simple-table-row notion-block-f66070b79fc740e4ac496096b0fa04de"><td class="" style="width:120px"><div class="notion-simple-table-cell">中文任务</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">四者盲测</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">隐藏产品名称，用自己的中文写作、改写与事实题投票</div></td></tr><tr class="notion-simple-table-row notion-block-44cef4a2f5c04112ac186cdbe5997a23"><td class="" style="width:120px"><div class="notion-simple-table-cell">高量批处理</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">转到 API 路径</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">聊天订阅额度动态，且不适合无人值守的可计量批处理</div></td></tr><tr class="notion-simple-table-row notion-block-a4976b02132942fdb0c02d09632da39a"><td class="" style="width:120px"><div class="notion-simple-table-cell">高价值复杂任务</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Claude Max、ChatGPT Pro；再试 SuperGrok</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">高档计划提供更多使用空间；不能假定 SuperGrok 固定运行 Grok 4.6</div></td></tr></tbody></table><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-c649a3a20c2841a4b666b3d57d2cb40d" data-id="c649a3a20c2841a4b666b3d57d2cb40d"><span><div id="c649a3a20c2841a4b666b3d57d2cb40d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#c649a3a20c2841a4b666b3d57d2cb40d" title="怎样用真实任务决定单用、组合使用或维持现状？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">怎样用真实任务决定单用、组合使用或维持现状？</span></span></h3><div class="notion-text notion-block-5dfa96603ddb45f48053c33b95cc6fe7">选择不需要以“永久迁移”开始。先挑 20 至 50 个真实样例，隐藏模型名称，以相同输入、工具权限和验收标准运行。</div><div class="notion-to-do notion-block-2e5925b943ee49f7928f6387638a0108"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">固定样例、提示和必要材料，并记录精确模型 ID 或产品套餐。</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-aac0be6a1f074d33861efd0459a09b9a"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">同时记录通过率、错误类型、首个结果等待时间和任务总耗时。</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-f4fd9a86ef9644c39c543f5aed366adf"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">API 记录输入、缓存、输出、推理、工具与重试账单。</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-506e0f43f90348f29e0c4c880b46197e"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">聊天产品记录模型是否可选、额度消耗、文件与工具是否稳定可用。</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-07ceea94cc5a4c0db98567cd15d8ee4c"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">让不知模型名称的评审者判断中文质量、引用准确性和可用性。</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-ae750c47966a4b88bca22d770fce3d7c"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">对失败任务记录人工修正时间，而不是只重跑到成功。</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-81fb3512685541f3a4f59f17b7cfd58e"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">先将少量非关键流量交给候选模型，再逐步扩大。</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-98bfe32f7b3a4de7a00259156fd6537d"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">保留现有模型、预算上限、超时和人工接管路径。</div></div><div class="notion-to-do-children"></div></div><div class="notion-text notion-block-6686e37dfa0546f7be49f6cca47fd79e">结果通常落在三种方案之一：</div><ol start="1" class="notion-list notion-list-numbered notion-block-0f93f15adc60431b8b9263f0afa17ef0" style="list-style-type:decimal"><li><b>单用</b>：一个候选在主要任务中稳定通过，完整成本和等待时间也可接受。</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-3c43d5f234e040759ee261c957b3e79d" style="list-style-type:decimal"><li><b>组合使用</b>：DeepSeek 承担高量文本任务，Claude、GPT 或 Grok 处理高价值、视觉或工具密集任务；路由规则必须来自实测结果。</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-00025c9fe1b044c1b73ecf18aa7e218d" style="list-style-type:decimal"><li><b>维持现状</b>：新方案没有稳定改善，产品入口或额度不确定，或者节省的 token 费用不足以覆盖重试和人工修正。</li></ol><div class="notion-text notion-block-eb8cb2c69f8a40c3accdc04d7dff61f4">最终顺序很简单：先区分聊天产品与 API，再定义真实任务；随后用模态、工具和上下文排除不满足硬约束的候选，比较完整任务成本与等待时间，最后才用真实样例决定单用、组合或维持现状。四个模型都可能在特定条件下合适，但没有一个名字可以替你跳过这条因果链。</div><hr class="notion-hr notion-block-b3a4a19cdc664701a87b6c66d32fb6fe"/><details class="notion-toggle notion-block-61715f1e4c324ca0a07d2dff593fa95f"><summary>资料与出处（能力评测截至 2026-08-13；价格复核于 2026-08-14）</summary><div><div class="notion-text notion-block-61663216089d4fe5970bbee8c751523a"><b>API 规格与价格（对应第 4 节）</b></div><ul class="notion-list notion-list-disc notion-block-2e42fbd0ec344475ae4ff1261e43b285"><li><a class="notion-link" href="https://api-docs.deepseek.com/zh-cn/quick_start/pricing" target="_blank" rel="noopener noreferrer">DeepSeek API 模型、当前价格与 8 月 17 日峰谷价</a></li></ul><ul class="notion-list notion-list-disc notion-block-71011fb8ccb246ab9c30431b0ff4809d"><li><a class="notion-link" href="https://api-docs.deepseek.com/updates" target="_blank" rel="noopener noreferrer">DeepSeek 更新记录与调价生效时间</a></li></ul><ul class="notion-list notion-list-disc notion-block-4156e694afef4de990c2374c5311c21b"><li><a class="notion-link" href="https://docs.x.ai/developers/grok-4-6" target="_blank" rel="noopener noreferrer">xAI：Grok 4.6</a></li></ul><ul class="notion-list notion-list-disc notion-block-691cb29691674da091f207bff9073b18"><li><a class="notion-link" href="https://docs.x.ai/developers/pricing" target="_blank" rel="noopener noreferrer">xAI API 价格</a></li></ul><ul class="notion-list notion-list-disc notion-block-e4a14da9d8944e5da7e6414db3e65248"><li><a class="notion-link" href="https://platform.claude.com/docs/en/about-claude/models/whats-new-opus-5" target="_blank" rel="noopener noreferrer">Anthropic：Claude Opus 5</a></li></ul><ul class="notion-list notion-list-disc notion-block-9e0d1a82e5ce41afa147739691a67ee1"><li><a class="notion-link" href="https://platform.claude.com/docs/en/about-claude/pricing" target="_blank" rel="noopener noreferrer">Anthropic API 价格</a></li></ul><ul class="notion-list notion-list-disc notion-block-1a2c777aee7b49fdb2b567c53c0eb2a0"><li><a class="notion-link" href="https://developers.openai.com/api/docs/models/gpt-5.6-sol" target="_blank" rel="noopener noreferrer">OpenAI：GPT-5.6 Sol API</a></li></ul><ul class="notion-list notion-list-disc notion-block-73402d2646c14a40848a467d0e01bf16"><li><a class="notion-link" href="https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview" target="_blank" rel="noopener noreferrer">Anthropic：客户端与服务端工具边界</a></li></ul><ul class="notion-list notion-list-disc notion-block-b317fcd318ad43f79bdffc0daff6d423"><li><a class="notion-link" href="https://docs.x.ai/developers/tools/overview" target="_blank" rel="noopener noreferrer">xAI：内置工具与函数调用边界</a></li></ul><ul class="notion-list notion-list-disc notion-block-6eb456465aaa440ea2dc689d7f2f9352"><li><a class="notion-link" href="https://developers.openai.com/api/docs/guides/tools" target="_blank" rel="noopener noreferrer">OpenAI：工具类型与执行方式</a></li></ul><div class="notion-text notion-block-bdc9107499ae44319b383586f2ce4e0e"><b>聊天产品与订阅（对应第 5、6 节）</b></div><ul class="notion-list notion-list-disc notion-block-b4fbff4b21d147109cd2f77d5e9fedda"><li><a class="notion-link" href="https://www.deepseek.com/en/" target="_blank" rel="noopener noreferrer">DeepSeek 官方网站</a></li></ul><ul class="notion-list notion-list-disc notion-block-983411a8d5fc467f821a0aaf0d293ddb"><li><a class="notion-link" href="https://api-docs.deepseek.com/news/news250115" target="_blank" rel="noopener noreferrer">DeepSeek App 功能说明</a></li></ul><ul class="notion-list notion-list-disc notion-block-4cfafb25a78f41bea6c2a07543acdb5e"><li><a class="notion-link" href="https://docs.x.ai/grok/overview" target="_blank" rel="noopener noreferrer">Grok 产品概览</a></li></ul><ul class="notion-list notion-list-disc notion-block-08ffc66872924ce18cafbd91dc55c280"><li><a class="notion-link" href="https://docs.x.ai/grok/faq" target="_blank" rel="noopener noreferrer">Grok FAQ 与共享周额度</a></li></ul><ul class="notion-list notion-list-disc notion-block-6cda1023283540e1ac9cad8c5642a59d"><li><a class="notion-link" href="https://claude.com/pricing" target="_blank" rel="noopener noreferrer">Claude 套餐与价格</a></li></ul><ul class="notion-list notion-list-disc notion-block-a911e6a51e354f00bdad0ef8852ff1cc"><li><a class="notion-link" href="https://openai.com/chatgpt/pricing/" target="_blank" rel="noopener noreferrer">ChatGPT 套餐与价格</a></li></ul><ul class="notion-list notion-list-disc notion-block-4f03d2f5c955486aa0218c7aae9689da"><li><a class="notion-link" href="https://openai.com/index/introducing-chatgpt-go/" target="_blank" rel="noopener noreferrer">ChatGPT Go</a></li></ul><ul class="notion-list notion-list-disc notion-block-69ab1858f8264efc861c87c5ef3a93e2"><li><a class="notion-link" href="https://help.openai.com/en/articles/9793128" target="_blank" rel="noopener noreferrer">ChatGPT Pro 说明</a></li></ul><ul class="notion-list notion-list-disc notion-block-c4020dfdf9694aaca54b59f3dac013ed"><li><a class="notion-link" href="https://help.openai.com/en/articles/20001354-gpt-56-in-chatgpt" target="_blank" rel="noopener noreferrer">GPT-5.6 在 ChatGPT 中的访问规则</a></li></ul><div class="notion-text notion-block-8367874f534d4e618856398ee56891d6"><b>独立能力证据（对应第 3、6 节）</b></div><ul class="notion-list notion-list-disc notion-block-2a512bf969e7447487f2c447956523ad"><li><a class="notion-link" href="https://artificialanalysis.ai/models" target="_blank" rel="noopener noreferrer">Artificial Analysis 模型比较与 Intelligence Index</a></li></ul><ul class="notion-list notion-list-disc notion-block-9afb7b71a3a547e7b1ec103ff43c64b8"><li><a class="notion-link" href="https://artificialanalysis.ai/evaluations/terminalbench-v2-1" target="_blank" rel="noopener noreferrer">Artificial Analysis Terminal-Bench v2.1</a></li></ul><ul class="notion-list notion-list-disc notion-block-9697c745d8c447be95ede0226edeb75a"><li><a class="notion-link" href="https://arena.ai/leaderboard/text/chinese" target="_blank" rel="noopener noreferrer">Arena 中文人类偏好榜</a></li></ul></div></details></main></div>]]></content:encoded>
        </item>
    </channel>
</rss>