{"id":116232,"date":"2026-10-20T23:56:35","date_gmt":"2026-10-20T15:56:35","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/116232.html"},"modified":"2026-10-20T23:56:35","modified_gmt":"2026-10-20T15:56:35","slug":"%e5%8f%8c-11-%e7%a7%92%e6%9d%80%e5%ba%93%e5%ad%98%e9%a2%84%e7%83%ad%e6%96%b9%e6%a1%88%ef%bc%9a%e5%b0%86-mysql-%e7%9c%9f%e5%ae%9e%e5%ba%93%e5%ad%98%e6%8f%90%e5%89%8d%e5%90%8c%e6%ad%a5%e8%87%b3-redis","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/116232.html","title":{"rendered":"\u53cc 11 \u79d2\u6740\u5e93\u5b58\u9884\u70ed\u65b9\u6848\uff1a\u5c06 MySQL \u771f\u5b9e\u5e93\u5b58\u63d0\u524d\u540c\u6b65\u81f3 Redis \u96c6\u7fa4\u7684\u9632\u8d85\u5356\u5b9e\u8df5"},"content":{"rendered":"<p>\u5728\u5927\u4fc3\u79d2\u6740\u7cfb\u7edf\u91cc&#xff0c;\u6700\u8ba9\u540e\u7aef\u5de5\u7a0b\u5e08\u591c\u4e0d\u80fd\u5bd0\u7684\u4e24\u4e2a\u8bcd&#xff0c;\u4e00\u4e2a\u662f\u201c\u8d85\u5356\u201d&#xff08;Over-selling&#xff09;&#xff0c;\u53e6\u4e00\u4e2a\u662f\u201c\u51fb\u7a7f\u201d&#xff08;Cache Breakdown&#xff09;\u3002<\/p>\n<p>\u8d85\u5356\u610f\u5473\u7740\u5b9e\u9645\u5e93\u5b58\u53ea\u6709 100 \u4ef6&#xff0c;\u7cfb\u7edf\u5374\u7531\u4e8e\u5e76\u53d1\u810f\u8bfb\u6263\u51cf\u4e86 150 \u4ef6&#xff0c;\u6700\u7ec8\u4e0d\u5f97\u4e0d\u5411\u7528\u6237\u6253\u7535\u8bdd\u9053\u6b49\u8d54\u507f&#xff0c;\u5e26\u6765\u76f4\u63a5\u7684\u8d44\u91d1\u4e0e\u58f0\u8a89\u635f\u5931&#xff1b;\u800c\u51fb\u7a7f\u5219\u610f\u5473\u7740\u79d2\u6740\u5f00\u62a2\u7684\u7b2c\u4e00\u6beb\u79d2&#xff0c;\u4e0a\u4e07\u4e2a\u5e76\u53d1\u8bf7\u6c42\u76f4\u63a5\u7ed5\u8fc7\u7f13\u5b58\u6253\u7a7f\u5230 MySQL&#xff0c;\u5f15\u53d1\u5168\u8868\u884c\u7ea7\u9501\u4e89\u7528&#xff0c;\u6570\u636e\u5e93\u77ac\u95f4\u9501\u6b7b\u5b95\u673a\u3002<\/p>\n<p>\u5f88\u591a\u65b0\u624b\u5e38\u72af\u7684\u9519\u8bef&#xff0c;\u5c31\u662f\u4ee5\u4e3a\u5728\u5e94\u7528\u5c42\u5199\u4e2a\u5206\u5e03\u5f0f\u9501&#xff08;\u5982 Redisson \u6216\u539f\u751f SETNX&#xff09;&#xff0c;\u6216\u8005\u5728 SQL \u91cc\u52a0\u4e00\u53e5 WHERE stock &gt;&#061; quantity \u5c31\u5b8c\u4e8b\u4e86\u3002\u5728\u51e0\u5343\u4e0a\u4e07 QPS \u7684\u79d2\u6740\u6d2a\u5cf0\u9762\u524d&#xff0c;\u53ea\u8981\u8bf7\u6c42\u771f\u6b63\u78b0\u5230\u4e86 MySQL \u7684\u5199\u76d8\u64cd\u4f5c&#xff0c;\u6570\u636e\u5e93\u7684\u541e\u5410\u5929\u82b1\u677f&#xff08;\u901a\u5e38\u53ea\u6709\u4e00\u4e24\u5343 TPS&#xff09;\u5c31\u4f1a\u7acb\u523b\u6210\u4e3a\u5168\u7ad9\u7684\u65ad\u5934\u8def\u3002<\/p>\n<p>\u6838\u5fc3\u539f\u5219\u53ea\u6709\u4e00\u6761&#xff1a;\u79d2\u6740\u5e93\u5b58\u6263\u51cf\u5fc5\u987b 100% \u5728 Redis \u5185\u5b58\u4e2d\u5b8c\u6210&#xff0c;\u7edd\u4e0d\u5141\u8bb8\u4e00\u4e2a\u672a\u6263\u51cf\u6210\u529f\u7684\u5199\u8bf7\u6c42\u6253\u5230\u6570\u636e\u5e93\u3002<\/p>\n<hr \/>\n<h3>\u4e00\u3001\u5e93\u5b58\u9884\u70ed\u4e0e\u5bf9\u9f50\u7684\u6807\u51c6\u6267\u884c\u6d41\u7a0b<\/h3>\n<p>\u8981\u8ba9 Redis \u6210\u4e3a\u4e00\u9053\u575a\u4e0d\u53ef\u6467\u7684\u9632\u706b\u5899&#xff0c;\u5173\u952e\u5728\u4e8e\u5927\u4fc3\u5f00\u62a2\u524d 10 \u5206\u949f\u7684\u5e93\u5b58\u9884\u70ed\u4e0e\u72b6\u6001\u5bf9\u9f50&#xff1a;<\/p>\n<p>[ \u79d2\u6740\u5f00\u62a2\u524d 15 \u5206\u949f (T-15m) ]<br \/>\n                \u2502<br \/>\n                \u25bc (\u5b9a\u65f6\u9884\u70ed\u4efb\u52a1)<br \/>\n[ \u4ece MySQL \u9501\u5b9a\u5f85\u79d2\u6740\u5546\u54c1\u5e93\u5b58 ]<br \/>\n  \u251c\u2500\u2500 \u72b6\u6001\u6807\u8bb0\u4e3a &#034;\u9884\u70ed\u4e2d&#034; (\u9632\u6b62\u540e\u53f0\u7ee7\u7eed\u88ab\u4fee\u6539)<br \/>\n  \u2514\u2500\u2500 \u751f\u6210\u5168\u5c40\u552f\u4e00\u7684\u5546\u54c1\u79d2\u6740\u7248\u672c\u53f7 (VersionID)<br \/>\n                \u2502<br \/>\n                \u25bc (\u5199\u5165 Redis \u96c6\u7fa4)<br \/>\n[ \u704c\u5165 Redis \u5185\u5b58 Key ]<br \/>\n  \u251c\u2500\u2500 string: seckill:stock:sku_1001 -&gt; &#034;100&#034; (\u771f\u5b9e\u5e93\u5b58)<br \/>\n  \u251c\u2500\u2500 hash:   seckill:users:sku_1001 -&gt; {}    (\u9632\u91cd\u9632\u5237\u6392\u91cd\u8868)<br \/>\n  \u2514\u2500\u2500 string: seckill:soldout:sku_1001 -&gt; &#034;0&#034; (\u552e\u7f44\u7194\u65ad\u6807\u8bb0)<br \/>\n                \u2502<br \/>\n                \u25bc (T-1m \u9884\u70ed\u5b8c\u6bd5)<br \/>\n[ \u9884\u70ed\u6821\u9a8c\u6838\u5bf9\u65e0\u8bef&#xff0c;\u5f00\u653e\u524d\u7aef\u5012\u8ba1\u65f6 ]<\/p>\n<hr \/>\n<h3>\u4e8c\u3001Lua \u811a\u672c\u5b9e\u73b0\u539f\u5b50\u6263\u51cf\u4e0e\u9632\u8d85\u5356\u53cc\u4fdd\u9669<\/h3>\n<p>\u5728 Redis \u4e2d\u6263\u51cf\u5e93\u5b58&#xff0c;\u7edd\u5bf9\u4e0d\u80fd\u5206\u6b65\u6267\u884c GET stock \u7136\u540e\u5224\u65ad\u518d DECR\u3002\u7f51\u7edc\u5f80\u8fd4\u5b58\u5728\u5929\u7136\u7684\u65f6\u95f4\u7a97\u53e3&#xff0c;\u591a\u5e76\u53d1\u4e0b\u5fc5\u53d1\u8d85\u5356\u3002\u5fc5\u987b\u4f7f\u7528\u4e00\u6bb5\u4e25\u8c28\u7684\u539f\u5b50 Lua \u811a\u672c&#xff0c;\u5728\u4e00\u4e2a\u4e8b\u52a1\u5185\u5b8c\u6210\u9632\u5237\u6821\u9a8c\u4e0e\u5e93\u5b58\u6263\u51cf&#xff1a;<\/p>\n<p>&#8212; KEYS[1]: \u5e93\u5b58\u952e\u540d (\u5982 seckill:stock:sku_1001)<br \/>\n&#8212; KEYS[2]: \u9632\u5237\u6392\u91cd\u952e\u540d (\u5982 seckill:buyers:sku_1001)<br \/>\n&#8212; ARGV[1]: \u5f53\u524d\u4e0b\u5355\u7528\u6237\u552f\u4e00 UID<br \/>\n&#8212; ARGV[2]: \u6263\u51cf\u6570\u91cf (\u4f8b\u5982 1)<\/p>\n<p>local stock_key &#061; KEYS[1]<br \/>\nlocal buyers_key &#061; KEYS[2]<br \/>\nlocal uid &#061; ARGV[1]<br \/>\nlocal quantity &#061; tonumber(ARGV[2])<\/p>\n<p>&#8212; 1. \u5e42\u7b49\u6821\u9a8c&#xff1a;\u540c\u4e00\u7528\u6237\u5728\u540c\u4e00\u6b21\u79d2\u6740\u4e2d\u4ec5\u9650\u62a2\u8d2d\u4e00\u6b21<br \/>\nif redis.call(&#039;HEXISTS&#039;, buyers_key, uid) &#061;&#061; 1 then<br \/>\n    return -1 &#8212; \u91cd\u590d\u62a2\u8d2d&#xff0c;\u76f4\u63a5\u62e6\u622a<br \/>\nend<\/p>\n<p>&#8212; 2. \u8bfb\u53d6\u5f53\u524d\u5269\u4f59\u5e93\u5b58<br \/>\nlocal current_stock &#061; tonumber(redis.call(&#039;GET&#039;, stock_key) or &#034;0&#034;)<\/p>\n<p>&#8212; 3. \u5224\u65ad\u5e93\u5b58\u662f\u5426\u5145\u8db3<br \/>\nif current_stock &lt; quantity then<br \/>\n    return 0 &#8212; \u5e93\u5b58\u4e0d\u8db3&#xff0c;\u5df2\u552e\u7f44<br \/>\nend<\/p>\n<p>&#8212; 4. \u539f\u5b50\u6263\u51cf\u5e93\u5b58\u5e76\u8bb0\u5f55\u6210\u529f\u4e70\u5bb6<br \/>\nredis.call(&#039;DECRBY&#039;, stock_key, quantity)<br \/>\nredis.call(&#039;HSET&#039;, buyers_key, uid, 1)<\/p>\n<p>return 1 &#8212; \u6263\u51cf\u6210\u529f&#xff0c;\u53d1\u653e\u8d2d\u4e70\u51ed\u636e<\/p>\n<hr \/>\n<h3>\u4e09\u3001Go \u8bed\u8a00\u5b9e\u73b0\u7684\u9ad8\u5e76\u53d1\u79d2\u6740\u62e6\u622a\u5668<\/h3>\n<p>\u5728 Go \u4e1a\u52a1\u7aef&#xff0c;\u6211\u4eec\u5728\u5185\u5b58\u4e2d\u7ef4\u62a4\u4e86\u4e00\u5957\u6781\u8f7b\u91cf\u7684\u5355\u673a\u672c\u5730\u552e\u7f44\u6807\u8bb0&#xff08;In-Memory Soldout Flag&#xff09;\u3002\u4e00\u65e6\u67d0\u4e2a\u5546\u54c1\u5728 Redis \u4e2d\u8fd4\u56de\u4e86\u5e93\u5b58\u4e3a 0&#xff0c;\u8be5\u6807\u8bb0\u5728\u672c\u5730\u8fdb\u7a0b\u5185\u7acb\u523b\u7f6e\u4e3a true\u3002\u540e\u7eed\u6d8c\u8fdb\u6765\u7684\u6570\u4e07\u5e76\u53d1\u8bf7\u6c42&#xff0c;\u76f4\u63a5\u5728\u672c\u5730\u5185\u5b58\u8fd4\u56de\u201c\u5df2\u552e\u7f44\u201d&#xff0c;\u8fde\u4e00\u6b21 Redis \u7f51\u7edc I\/O \u90fd\u7701\u6389\u4e86\u3002<\/p>\n<p>package seckill<\/p>\n<p>import (<br \/>\n&#034;context&#034;<br \/>\n&#034;errors&#034;<br \/>\n&#034;fmt&#034;<br \/>\n&#034;sync&#034;<br \/>\n)<\/p>\n<p>type SeckillManager struct {<br \/>\nmu           sync.RWMutex<br \/>\nsoldoutFlags map[int64]bool \/\/ \u672c\u5730\u552e\u7f44\u5feb\u901f\u7194\u65ad\u7f13\u5b58<br \/>\nredisClient  RedisLuaExecutor<br \/>\n}<\/p>\n<p>type RedisLuaExecutor interface {<br \/>\nExecSeckillLua(ctx context.Context, skuID int64, userID string, quantity int) (int, error)<br \/>\n}<\/p>\n<p>func NewSeckillManager(client RedisLuaExecutor) *SeckillManager {<br \/>\nreturn &amp;SeckillManager{<br \/>\nsoldoutFlags: make(map[int64]bool),<br \/>\nredisClient:  client,<br \/>\n}<br \/>\n}<\/p>\n<p>\/\/ TryAcquireSeckillQuota \u79d2\u6740\u914d\u989d\u83b7\u53d6\u5165\u53e3<br \/>\nfunc (m *SeckillManager) TryAcquireSeckillQuota(ctx context.Context, skuID int64, userID string, quantity int) error {<br \/>\n\/\/ \u7b2c\u4e00\u9053\u68c0\u67e5&#xff1a;\u5355\u673a\u5185\u5b58\u76f4\u63a5\u963b\u65ad&#xff08;0 \u7f51\u7edc\u5f00\u9500&#xff09;<br \/>\nm.mu.RLock()<br \/>\nif m.soldoutFlags[skuID] {<br \/>\nm.mu.RUnlock()<br \/>\nreturn errors.New(&#034;\u5546\u54c1\u5df2\u62a2\u5149 (\u672c\u5730\u5feb\u901f\u7194\u65ad)&#034;)<br \/>\n}<br \/>\nm.mu.RUnlock()<\/p>\n<p>\/\/ \u7b2c\u4e8c\u9053\u68c0\u67e5&#xff1a;\u6253\u5165 Redis \u6267\u884c\u539f\u5b50 Lua \u811a\u672c<br \/>\nstatus, err :&#061; m.redisClient.ExecSeckillLua(ctx, skuID, userID, quantity)<br \/>\nif err !&#061; nil {<br \/>\nreturn fmt.Errorf(&#034;redis execution error: %w&#034;, err)<br \/>\n}<\/p>\n<p>switch status {<br \/>\ncase 1:<br \/>\n\/\/ \u6263\u51cf\u6210\u529f&#xff0c;\u53ef\u4ee5\u5f02\u6b65\u6295\u9012\u81f3 Kafka&#xff0c;\u7531\u540e\u53f0\u5e73\u6ed1\u5165\u5e93\u843d\u76d8<br \/>\nreturn nil<br \/>\ncase 0:<br \/>\n\/\/ \u5df2\u7ecf\u552e\u7f44&#xff1a;\u7acb\u523b\u66f4\u65b0\u672c\u5730\u6807\u8bb0&#xff0c;\u963b\u65ad\u540e\u7eed\u5e76\u53d1\u6253\u6270 Redis<br \/>\nm.mu.Lock()<br \/>\nm.soldoutFlags[skuID] &#061; true<br \/>\nm.mu.Unlock()<br \/>\nreturn errors.New(&#034;\u624b\u6162\u4e86&#xff0c;\u5546\u54c1\u5df2\u62a2\u5149&#034;)<br \/>\ncase -1:<br \/>\nreturn errors.New(&#034;\u60a8\u5df2\u53c2\u4e0e\u8fc7\u672c\u6b21\u79d2\u6740&#xff0c;\u8bf7\u52ff\u91cd\u590d\u4e0b\u5355&#034;)<br \/>\ndefault:<br \/>\nreturn errors.New(&#034;\u7cfb\u7edf\u7e41\u5fd9&#xff0c;\u8bf7\u7a0d\u5019\u518d\u8bd5&#034;)<br \/>\n}<br \/>\n}<\/p>\n<hr \/>\n<h3>\u56db\u3001\u5f02\u6b65\u56de\u5199\u6570\u636e\u5e93\u4e0e\u6700\u7ec8\u4e00\u81f4\u6027\u907f\u5751<\/h3>\n<p>\u5728 Redis \u6263\u51cf\u6210\u529f\u540e&#xff0c;\u771f\u6b63\u7684\u201c\u6301\u4e45\u5316\u8ba2\u5355\u521b\u5efa\u201d\u7edd\u5bf9\u4e0d\u80fd\u540c\u6b65\u53bb\u5199 MySQL&#xff0c;\u800c\u662f\u91c7\u7528\u53ef\u9760\u6d88\u606f\u961f\u5217&#xff08;\u5982 Kafka \/ RabbitMQ&#xff09;\u8fdb\u884c\u524a\u5cf0\u5f02\u6b65\u56de\u5199&#xff1a;<\/p>\n<li>\u6d88\u606f\u961f\u5217\u5e73\u6ed1\u6d88\u8d39&#xff1a;\u5c06\u5e76\u53d1 10,000 QPS \u7684\u77ac\u65f6\u7206\u53d1\u8bf7\u6c42\u538b\u5165 Kafka&#xff0c;\u540e\u53f0\u7531 8 \u4e2a Worker \u7ebf\u7a0b\u4ee5\u6bcf\u79d2 500 \u6b21\u7684\u5e73\u7a33\u901f\u7387\u5411 MySQL \u6267\u884c\u6279\u5904\u7406\u63d2\u5165&#xff08;INSERT INTO orders &#8230;&#xff09;&#xff0c;\u4e3b\u5e93\u6beb\u65e0\u6ce2\u6f9c\u3002<\/li>\n<li>\u5e93\u5b58\u56de\u6eda\u8865\u507f&#xff08;Saga \u673a\u5236&#xff09;&#xff1a;\u5982\u679c\u7528\u6237\u62a2\u5230\u8d44\u683c\u540e\u5728 15 \u5206\u949f\u5185\u672a\u5b8c\u6210\u6700\u7ec8\u652f\u4ed8&#xff0c;\u8d85\u65f6\u672a\u652f\u4ed8\u7684\u5b9a\u65f6\u626b\u63cf\u4efb\u52a1\u5fc5\u987b\u901a\u8fc7\u9006\u5411 Lua \u811a\u672c&#xff1a;INCRBY seckill:stock:sku_1001 1 \u5e76\u5220\u9664 buyers_key \u91cc\u7684 UID&#xff0c;\u8ba9\u5e93\u5b58\u5e73\u6ed1\u56de\u5f52&#xff0c;\u7edd\u4e0d\u538b\u6b7b\u4efb\u4f55\u4e00\u5f20\u6709\u6548\u5e93\u5b58\u3002<\/li>\n<hr \/>\n<h3>\u4e94\u3001\u67b6\u6784\u5e08\u9ad8\u5e76\u53d1\u9632\u8d85\u5356 Checklist<\/h3>\n<p>\u5728\u5c06\u79d2\u6740\u6263\u5e93\u5b58\u94fe\u8def\u63a8\u5411\u751f\u4ea7\u5927\u4fc3\u524d&#xff0c;\u5fc5\u987b\u9010\u9879\u6838\u5bf9\u4ee5\u4e0b\u67b6\u6784\u9632\u7ebf&#xff1a;<\/p>\n<li>\u552f\u4e00\u4e1a\u52a1\u7ea6\u675f\u5f3a\u515c\u5e95&#xff08;Database Hard Constraint&#xff09;&#xff1a;\u5728\u6301\u4e45\u5316\u8ba2\u5355\u8868\u4e2d&#xff0c;\u5fc5\u987b\u4e3a sku_id &#043; user_id \u5efa\u7acb\u8054\u5408\u552f\u4e00\u7d22\u5f15&#xff08;uk_sku_user&#xff09;\u3002\u54ea\u6015\u6d88\u606f\u961f\u5217\u53d1\u751f\u7f51\u7edc\u91cd\u8bd5\u751a\u81f3\u91cd\u590d\u6d88\u8d39&#xff0c;\u6570\u636e\u5e93\u5e95\u5c42\u7684\u7269\u7406\u552f\u4e00\u7d22\u5f15\u4e5f\u80fd\u5728\u6beb\u79d2\u7ea7\u5f7b\u5e95\u62e6\u622a\u91cd\u590d\u843d\u5355&#xff0c;\u575a\u51b3\u4e0d\u7ed9\u4efb\u4f55\u5e76\u53d1\u6f0f\u6d1e\u7559\u4e0b\u7a7a\u95f4\u3002<\/li>\n<li>\u70ed\u70b9\u9884\u70ed\u4e0e\u7f13\u5b58\u51fb\u7a7f\u9632\u62a4&#xff1a;\u5927\u4fc3\u5f00\u62a2\u524d 30 \u5206\u949f&#xff0c;\u540e\u53f0\u8fd0\u7ef4\u7cfb\u7edf\u5fc5\u987b\u5bf9\u53c2\u4e0e\u79d2\u6740\u7684\u5168\u90e8 SKU \u5b8c\u6210\u7f13\u5b58\u9884\u70ed&#xff0c;\u5e76\u5728 Redis \u952e\u8fc7\u671f\u65f6\u95f4\u4e0a\u589e\u52a0 5~10 \u5206\u949f\u7684\u968f\u673a\u504f\u79fb\u91cf&#xff08;Jitter&#xff09;&#xff0c;\u675c\u7edd\u6210\u767e\u4e0a\u5343\u4e2a\u70ed\u70b9\u952e\u5728\u540c\u4e00\u79d2\u5185\u96c6\u4f53\u5931\u6548\u5bfc\u81f4\u7f13\u5b58\u96ea\u5d29\u3002<\/li>\n<li>\u5f02\u6b65\u5bf9\u8d26\u4e0e\u5b64\u513f\u5e93\u5b58\u81ea\u6108&#xff1a;\u8bbe\u7f6e\u4e13\u95e8\u7684\u540e\u53f0\u5de1\u68c0\u5bf9\u8d26 Worker&#xff0c;\u6bcf\u9694 5 \u5206\u949f\u6bd4\u5bf9\u4e00\u6b21 Redis \u5269\u4f59\u5e93\u5b58\u4e0e MySQL \u771f\u5b9e\u843d\u76d8\u8ba2\u5355\u603b\u6570\u3002\u4e00\u65e6\u53d1\u73b0\u7531\u4e8e\u8282\u70b9\u610f\u5916\u65ad\u7f51\u5bfc\u81f4\u7684\u5dee\u5f02&#xff0c;\u81ea\u52a8\u751f\u6210\u8865\u507f\u4e8b\u4ef6\u89e6\u53d1\u5e73\u6ed1\u6821\u51c6&#xff0c;\u786e\u4fdd\u5e93\u5b58\u8d26\u5b9e 100% \u76f8\u7b26\u3002<\/li>\n<p>\u901a\u8fc7\u8fd9\u5957\u201c\u63d0\u524d\u9884\u70ed &#043; \u5185\u5b58\u963b\u65ad &#043; \u539f\u5b50 Lua &#043; \u5f02\u6b65\u524a\u5cf0 &#043; \u6570\u636e\u5e93\u786c\u7ea6\u675f\u201d\u7684\u7ec4\u5408\u62f3&#xff0c;\u6211\u4eec\u5728\u53cc 11 \u524d\u7684\u4e09\u8f6e\u5168\u94fe\u8def\u538b\u6d4b\u4e2d\u5b9e\u73b0\u4e86\u79d2\u6740\u63a5\u53e3 12,000 QPS \u96f6\u6545\u969c\u3001\u96f6\u8d85\u5356\u3001\u96f6\u6570\u636e\u5e93\u963b\u585e&#xff0c;\u771f\u6b63\u628a\u9ad8\u5e76\u53d1\u7cfb\u7edf\u7684\u9632\u7ebf\u94f8\u6210\u4e86\u94dc\u5899\u94c1\u58c1\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5927\u4fc3\u79d2\u6740\u7cfb\u7edf\u91cc&#xff0c;\u6700\u8ba9\u540e\u7aef\u5de5\u7a0b\u5e08\u591c\u4e0d\u80fd\u5bd0\u7684\u4e24\u4e2a\u8bcd&#xff0c;\u4e00\u4e2a\u662f\u201c\u8d85\u5356\u201d&#xff08;Over-selling&#xff09;&#xff0c;\u53e6\u4e00\u4e2a\u662f\u201c\u51fb\u7a7f\u201d&#xff08;Cache Breakdown&#xff09;\u3002<br \/>\n\u8d85\u5356\u610f\u5473\u7740\u5b9e\u9645\u5e93\u5b58\u53ea\u6709 100 \u4ef6&#xff0c;\u7cfb\u7edf\u5374\u7531\u4e8e\u5e76\u53d1\u810f\u8bfb\u6263\u51cf\u4e86 150 \u4ef6&#xff0c;\u6700\u7ec8\u4e0d\u5f97\u4e0d\u5411\u7528\u6237\u6253\u7535\u8bdd\u9053\u6b49\u8d54\u507f&#xff0c;\u5e26\u6765\u76f4\u63a5\u7684\u8d44\u91d1\u4e0e\u58f0\u8a89\u635f\u5931&#xff1b;\u800c\u51fb\u7a7f\u5219\u610f\u5473\u7740\u79d2\u6740\u5f00\u62a2\u7684\u7b2c\u4e00\u6beb\u79d2&amp;#xff0c<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[66,745,50,292,5370],"topic":[],"class_list":["post-116232","post","type-post","status-publish","format-standard","hentry","category-server","tag-ai","tag-go","tag-50","tag-292","tag-5370"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u53cc 11 \u79d2\u6740\u5e93\u5b58\u9884\u70ed\u65b9\u6848\uff1a\u5c06 MySQL \u771f\u5b9e\u5e93\u5b58\u63d0\u524d\u540c\u6b65\u81f3 Redis \u96c6\u7fa4\u7684\u9632\u8d85\u5356\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/116232.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u53cc 11 \u79d2\u6740\u5e93\u5b58\u9884\u70ed\u65b9\u6848\uff1a\u5c06 MySQL \u771f\u5b9e\u5e93\u5b58\u63d0\u524d\u540c\u6b65\u81f3 Redis \u96c6\u7fa4\u7684\u9632\u8d85\u5356\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5728\u5927\u4fc3\u79d2\u6740\u7cfb\u7edf\u91cc&#xff0c;\u6700\u8ba9\u540e\u7aef\u5de5\u7a0b\u5e08\u591c\u4e0d\u80fd\u5bd0\u7684\u4e24\u4e2a\u8bcd&#xff0c;\u4e00\u4e2a\u662f\u201c\u8d85\u5356\u201d&#xff08;Over-selling&#xff09;&#xff0c;\u53e6\u4e00\u4e2a\u662f\u201c\u51fb\u7a7f\u201d&#xff08;Cache Breakdown&#xff09;\u3002 \u8d85\u5356\u610f\u5473\u7740\u5b9e\u9645\u5e93\u5b58\u53ea\u6709 100 \u4ef6&#xff0c;\u7cfb\u7edf\u5374\u7531\u4e8e\u5e76\u53d1\u810f\u8bfb\u6263\u51cf\u4e86 150 \u4ef6&#xff0c;\u6700\u7ec8\u4e0d\u5f97\u4e0d\u5411\u7528\u6237\u6253\u7535\u8bdd\u9053\u6b49\u8d54\u507f&#xff0c;\u5e26\u6765\u76f4\u63a5\u7684\u8d44\u91d1\u4e0e\u58f0\u8a89\u635f\u5931&#xff1b;\u800c\u51fb\u7a7f\u5219\u610f\u5473\u7740\u79d2\u6740\u5f00\u62a2\u7684\u7b2c\u4e00\u6beb\u79d2&amp;#xff0c\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/116232.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-20T15:56:35+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/116232.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/116232.html\",\"name\":\"\u53cc 11 \u79d2\u6740\u5e93\u5b58\u9884\u70ed\u65b9\u6848\uff1a\u5c06 MySQL \u771f\u5b9e\u5e93\u5b58\u63d0\u524d\u540c\u6b65\u81f3 Redis \u96c6\u7fa4\u7684\u9632\u8d85\u5356\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-20T15:56:35+00:00\",\"dateModified\":\"2026-10-20T15:56:35+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/116232.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/116232.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/116232.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u53cc 11 \u79d2\u6740\u5e93\u5b58\u9884\u70ed\u65b9\u6848\uff1a\u5c06 MySQL \u771f\u5b9e\u5e93\u5b58\u63d0\u524d\u540c\u6b65\u81f3 Redis \u96c6\u7fa4\u7684\u9632\u8d85\u5356\u5b9e\u8df5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u53cc 11 \u79d2\u6740\u5e93\u5b58\u9884\u70ed\u65b9\u6848\uff1a\u5c06 MySQL \u771f\u5b9e\u5e93\u5b58\u63d0\u524d\u540c\u6b65\u81f3 Redis \u96c6\u7fa4\u7684\u9632\u8d85\u5356\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/116232.html","og_locale":"zh_CN","og_type":"article","og_title":"\u53cc 11 \u79d2\u6740\u5e93\u5b58\u9884\u70ed\u65b9\u6848\uff1a\u5c06 MySQL \u771f\u5b9e\u5e93\u5b58\u63d0\u524d\u540c\u6b65\u81f3 Redis \u96c6\u7fa4\u7684\u9632\u8d85\u5356\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5728\u5927\u4fc3\u79d2\u6740\u7cfb\u7edf\u91cc&#xff0c;\u6700\u8ba9\u540e\u7aef\u5de5\u7a0b\u5e08\u591c\u4e0d\u80fd\u5bd0\u7684\u4e24\u4e2a\u8bcd&#xff0c;\u4e00\u4e2a\u662f\u201c\u8d85\u5356\u201d&#xff08;Over-selling&#xff09;&#xff0c;\u53e6\u4e00\u4e2a\u662f\u201c\u51fb\u7a7f\u201d&#xff08;Cache Breakdown&#xff09;\u3002 \u8d85\u5356\u610f\u5473\u7740\u5b9e\u9645\u5e93\u5b58\u53ea\u6709 100 \u4ef6&#xff0c;\u7cfb\u7edf\u5374\u7531\u4e8e\u5e76\u53d1\u810f\u8bfb\u6263\u51cf\u4e86 150 \u4ef6&#xff0c;\u6700\u7ec8\u4e0d\u5f97\u4e0d\u5411\u7528\u6237\u6253\u7535\u8bdd\u9053\u6b49\u8d54\u507f&#xff0c;\u5e26\u6765\u76f4\u63a5\u7684\u8d44\u91d1\u4e0e\u58f0\u8a89\u635f\u5931&#xff1b;\u800c\u51fb\u7a7f\u5219\u610f\u5473\u7740\u79d2\u6740\u5f00\u62a2\u7684\u7b2c\u4e00\u6beb\u79d2&amp;#xff0c","og_url":"https:\/\/www.wsisp.com\/helps\/116232.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-20T15:56:35+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/116232.html","url":"https:\/\/www.wsisp.com\/helps\/116232.html","name":"\u53cc 11 \u79d2\u6740\u5e93\u5b58\u9884\u70ed\u65b9\u6848\uff1a\u5c06 MySQL \u771f\u5b9e\u5e93\u5b58\u63d0\u524d\u540c\u6b65\u81f3 Redis \u96c6\u7fa4\u7684\u9632\u8d85\u5356\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-20T15:56:35+00:00","dateModified":"2026-10-20T15:56:35+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/116232.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/116232.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/116232.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u53cc 11 \u79d2\u6740\u5e93\u5b58\u9884\u70ed\u65b9\u6848\uff1a\u5c06 MySQL \u771f\u5b9e\u5e93\u5b58\u63d0\u524d\u540c\u6b65\u81f3 Redis \u96c6\u7fa4\u7684\u9632\u8d85\u5356\u5b9e\u8df5"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/116232","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=116232"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/116232\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=116232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=116232"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=116232"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=116232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}