{"id":212,"date":"2017-01-22T02:43:14","date_gmt":"2017-01-22T02:43:14","guid":{"rendered":""},"modified":"2017-01-22T02:43:14","modified_gmt":"2017-01-22T02:43:14","slug":"","status":"publish","type":"post","link":"http:\/\/weizn.net\/?p=212","title":{"rendered":"[\u8f6c]\u8bbe\u7f6eRedis\u6700\u5927\u5360\u7528\u5185\u5b58"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_17 counter-hierarchy\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\">\u76ee\u5f55<\/p>\n<span class=\"ez-toc-title-toggle\"><a class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" style=\"display: none;\"><i class=\"ez-toc-glyphicon ez-toc-icon-toggle\"><\/i><\/a><\/span><\/div>\n<nav><ul class=\"ez-toc-list ez-toc-list-level-1\"><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-1\" href=\"http:\/\/weizn.net\/?p=212\/#%E8%AE%BE%E7%BD%AERedis%E6%9C%80%E5%A4%A7%E5%8D%A0%E7%94%A8%E5%86%85%E5%AD%98\" title=\"\n\t\u8bbe\u7f6eRedis\u6700\u5927\u5360\u7528\u5185\u5b58 \n\">\n\t\u8bbe\u7f6eRedis\u6700\u5927\u5360\u7528\u5185\u5b58 \n<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-2\" href=\"http:\/\/weizn.net\/?p=212\/#Redis%E4%BD%BF%E7%94%A8%E8%B6%85%E8%BF%87%E8%AE%BE%E7%BD%AE%E7%9A%84%E6%9C%80%E5%A4%A7%E5%80%BC\" title=\"\n\tRedis\u4f7f\u7528\u8d85\u8fc7\u8bbe\u7f6e\u7684\u6700\u5927\u503c \n\">\n\tRedis\u4f7f\u7528\u8d85\u8fc7\u8bbe\u7f6e\u7684\u6700\u5927\u503c \n<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-3\" href=\"http:\/\/weizn.net\/?p=212\/#info%E5%91%BD%E4%BB%A4%E6%9F%A5%E7%9C%8BRedis%E5%86%85%E5%AD%98%E4%BD%BF%E7%94%A8%E6%83%85%E5%86%B5\" title=\"\n\tinfo\u547d\u4ee4\u67e5\u770bRedis\u5185\u5b58\u4f7f\u7528\u60c5\u51b5 \n\">\n\tinfo\u547d\u4ee4\u67e5\u770bRedis\u5185\u5b58\u4f7f\u7528\u60c5\u51b5 \n<\/a><\/li><\/ul><\/nav><\/div>\n<p style=\"margin-top:0px;margin-bottom:0.75em;font-size:16px;line-height:27.2px;text-indent:1em;color:#333333;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;white-space:normal;background-color:#FEFEFE;\">\n\t<span style=\"color:#999999;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;font-size:14px;line-height:21px;white-space:normal;float:left;background-color:#FEFEFE;\">\u539f\u6587<\/span><span style=\"color:#999999;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;font-size:14px;line-height:21px;white-space:normal;background-color:#FEFEFE;\">&nbsp;&nbsp;<\/span><a class=\"cut cut70\" href=\"http:\/\/blog.tanteng.me\/2016\/03\/redis-maxmemory\/?utm_source=tuicool&amp;utm_medium=referral\" style=\"color:#333333;text-decoration:none;transition:0.25s;outline:none 0px;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;max-width:69%;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;font-size:14px;line-height:21px;display:inline-block;background-color:#FEFEFE;\">http:\/\/blog.tanteng.me\/2016\/03\/redis-maxmemory\/<\/a>\n<\/p>\n<p style=\"margin-top:0px;margin-bottom:0.75em;font-size:16px;line-height:27.2px;text-indent:1em;color:#333333;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;white-space:normal;background-color:#FEFEFE;\">\n\tRedis\u9700\u8981\u8bbe\u7f6e\u6700\u5927\u5360\u7528\u5185\u5b58\u5417\uff1f\u5982\u679cRedis\u5185\u5b58\u4f7f\u7528\u8d85\u51fa\u4e86\u8bbe\u7f6e\u7684\u6700\u5927\u503c\u4f1a\u600e\u6837\uff1f\n<\/p>\n<h3 style=\"margin:0px 0px 0.5em;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;line-height:1.6em;color:#333333;text-rendering:optimizeLegibility;font-size:18px;text-indent:1em;white-space:normal;background-color:#FEFEFE;\"><span class=\"ez-toc-section\" id=\"%E8%AE%BE%E7%BD%AERedis%E6%9C%80%E5%A4%A7%E5%8D%A0%E7%94%A8%E5%86%85%E5%AD%98\"><\/span>\n\t\u8bbe\u7f6eRedis\u6700\u5927\u5360\u7528\u5185\u5b58<br \/>\n<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"margin-top:0px;margin-bottom:0.75em;font-size:16px;line-height:27.2px;text-indent:1em;color:#333333;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;white-space:normal;background-color:#FEFEFE;\">\n\tRedis\u8bbe\u7f6e\u6700\u5927\u5360\u7528\u5185\u5b58\uff0c\u6253\u5f00redis\u914d\u7f6e\u6587\u4ef6\uff0c\u627e\u5230\u5982\u4e0b\u6bb5\u843d\uff0c\u8bbe\u7f6emaxmemory\u53c2\u6570\uff0cmaxmemory\u662fbytes\u5b57\u8282\u7c7b\u578b\uff0c\u6ce8\u610f\u8f6c\u6362\u3002\u4fee\u6539\u5982\u4e0b\u6240\u793a\uff1a\n<\/p>\n<div style=\"font-size:16px;line-height:27.2px;color:#333333;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;white-space:normal;background-color:#FEFEFE;\">\n<pre class=\"prettyprint hljs nginx\" style=\"padding:0.5em;font-family:Menlo, Monaco, Consolas, 'Courier New', monospace;color:#444444;border-radius:4px;margin-top:0px;margin-bottom:1.5em;font-size:14px;line-height:1.5em;word-break:break-all;word-wrap:break-word;border:none;overflow-x:auto;background-color:#F6F6F6;\"><span class=\"hljs-comment\" style=\"color:#888888;\"># In short... if youhaveslavesattacheditissuggestedthatyouset a lower<\/span> <span class=\"hljs-comment\" style=\"color:#888888;\"># limitfor maxmemorysothatthereissomefreeRAMonthesystemfor slave<\/span> <span class=\"hljs-comment\" style=\"color:#888888;\"># outputbuffers (butthisisnotneededif thepolicyis 'noeviction').<\/span> <span class=\"hljs-comment\" style=\"color:#888888;\">#<\/span> <span class=\"hljs-comment\" style=\"color:#888888;\"># maxmemory &lt;bytes&gt;<\/span> <span class=\"hljs-attribute\" style=\"color:#333333;font-weight:700;\">maxmemory<\/span> <span class=\"hljs-number\" style=\"color:#880000;\">268435456<\/span> <\/pre>\n<\/div>\n<p style=\"margin-top:0px;margin-bottom:0.75em;font-size:16px;line-height:27.2px;text-indent:1em;color:#333333;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;white-space:normal;background-color:#FEFEFE;\">\n\t\u672c\u673a\u670d\u52a1\u5668redis\u914d\u7f6e\u6587\u4ef6\u8def\u5f84\uff1a\/etc\/redis\/6379.conf\uff0c\u7531\u4e8e\u672c\u673a\u81ea\u5e26\u5185\u5b58\u53ea\u67091G\uff0c\u4e00\u822c\u63a8\u8350Redis\u8bbe\u7f6e\u5185\u5b58\u4e3a\u6700\u5927\u7269\u7406\u5185\u5b58\u7684\u56db\u5206\u4e4b\u4e09\uff0c\u6240\u4ee5\u8bbe\u7f6e0.75G\uff0c\u6362\u6210byte\u662f751619276.\n<\/p>\n<p style=\"margin-top:0px;margin-bottom:0.75em;font-size:16px;line-height:27.2px;text-indent:1em;color:#333333;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;white-space:normal;background-color:#FEFEFE;\">\n\t\u53ef\u4ee5\u5728CentOS\u4e0b\u8f93\u5165\u547d\u4ee4\uff1afind \/ -name redis\u67e5\u627eredis\u76ee\u5f55\uff1a\n<\/p>\n<div style=\"font-size:16px;line-height:27.2px;color:#333333;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;white-space:normal;background-color:#FEFEFE;\">\n<p style=\"margin-top:0px;margin-bottom:0.75em;line-height:1.7em;text-indent:1em;\">\n\t\t[root@iZ94r80gdghZ ~]# find \/ -name redis\n\t<\/p>\n<p style=\"margin-top:0px;margin-bottom:0.75em;line-height:1.7em;text-indent:1em;\">\n\t\t\/usr\/share\/nginx\/html\/blog.tanteng.me\/wp-content\/cache\/supercache\/blog.tanteng.me\/tag\/redis\n\t<\/p>\n<p style=\"margin-top:0px;margin-bottom:0.75em;line-height:1.7em;text-indent:1em;\">\n\t\t\/etc\/redis\n\t<\/p>\n<p style=\"margin-top:0px;margin-bottom:0.75em;line-height:1.7em;text-indent:1em;\">\n\t\t\/var\/redis\n\t<\/p>\n<\/div>\n<p style=\"margin-top:0px;margin-bottom:0.75em;font-size:16px;line-height:27.2px;text-indent:1em;color:#333333;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;white-space:normal;background-color:#FEFEFE;\">\n\tRedis\u914d\u7f6e\u6587\u4ef6\u4e00\u822c\u5728etc\u4e0b\u7684redis\u5b89\u88c5\u76ee\u5f55\u4e0b\u3002\n<\/p>\n<h3 style=\"margin:0px 0px 0.5em;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;line-height:1.6em;color:#333333;text-rendering:optimizeLegibility;font-size:18px;text-indent:1em;white-space:normal;background-color:#FEFEFE;\"><span class=\"ez-toc-section\" id=\"Redis%E4%BD%BF%E7%94%A8%E8%B6%85%E8%BF%87%E8%AE%BE%E7%BD%AE%E7%9A%84%E6%9C%80%E5%A4%A7%E5%80%BC\"><\/span>\n\tRedis\u4f7f\u7528\u8d85\u8fc7\u8bbe\u7f6e\u7684\u6700\u5927\u503c<br \/>\n<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"margin-top:0px;margin-bottom:0.75em;font-size:16px;line-height:27.2px;text-indent:1em;color:#333333;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;white-space:normal;background-color:#FEFEFE;\">\n\t\u5982\u679cRedis\u7684\u4f7f\u7528\u8d85\u8fc7\u4e86\u8bbe\u7f6e\u7684\u6700\u5927\u503c\u4f1a\u600e\u6837\uff1f\u6211\u4eec\u6765\u6539\u4e00\u6539\u4e0a\u9762\u7684\u914d\u7f6e\uff0c\u6545\u610f\u628a\u6700\u5927\u503c\u8bbe\u4e3a1\u4e2abyte\u8bd5\u8bd5\u3002\n<\/p>\n<div style=\"font-size:16px;line-height:27.2px;color:#333333;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;white-space:normal;background-color:#FEFEFE;\">\n<pre class=\"prettyprint hljs nginx\" style=\"padding:0.5em;font-family:Menlo, Monaco, Consolas, 'Courier New', monospace;color:#444444;border-radius:4px;margin-top:0px;margin-bottom:1.5em;font-size:14px;line-height:1.5em;word-break:break-all;word-wrap:break-word;border:none;overflow-x:auto;background-color:#F6F6F6;\"><span class=\"hljs-comment\" style=\"color:#888888;\"># outputbuffers (butthisisnotneededif thepolicyis 'noeviction').<\/span> <span class=\"hljs-comment\" style=\"color:#888888;\">#<\/span> <span class=\"hljs-comment\" style=\"color:#888888;\"># maxmemory &lt;bytes&gt;<\/span> <span class=\"hljs-attribute\" style=\"color:#333333;font-weight:700;\">maxmemory<\/span> <span class=\"hljs-number\" style=\"color:#880000;\">1<\/span> <\/pre>\n<\/div>\n<p style=\"margin-top:0px;margin-bottom:0.75em;font-size:16px;line-height:27.2px;text-indent:1em;color:#333333;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;white-space:normal;background-color:#FEFEFE;\">\n\t\u6253\u5f00debug\u6a21\u5f0f\u4e0b\u7684\u9875\u9762\uff0c\u63d0\u793a\u9519\u8bef\uff1aOOM command not allowed when used memory &gt; \u2018maxmemory\u2019.\n<\/p>\n<p style=\"margin-top:0px;margin-bottom:0.75em;font-size:16px;line-height:27.2px;text-indent:1em;color:#333333;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;white-space:normal;background-color:#FEFEFE;\">\n\t\u8bbe\u7f6e\u4e86maxmemory\u7684\u9009\u9879\uff0credis\u5185\u5b58\u4f7f\u7528\u8fbe\u5230\u4e0a\u9650\u3002\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6eLRU\u7b97\u6cd5\u6765\u5220\u9664\u90e8\u5206key\uff0c\u91ca\u653e\u7a7a\u95f4\u3002\u9ed8\u8ba4\u662f\u6309\u7167\u8fc7\u671f\u65f6\u95f4\u7684,\u5982\u679cset\u65f6\u5019\u6ca1\u6709\u52a0\u4e0a\u8fc7\u671f\u65f6\u95f4\u5c31\u4f1a\u5bfc\u81f4\u6570\u636e\u5199\u6ee1maxmemory\u3002\n<\/p>\n<p style=\"margin-top:0px;margin-bottom:0.75em;font-size:16px;line-height:27.2px;text-indent:1em;color:#333333;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;white-space:normal;background-color:#FEFEFE;\">\n\t\u5982\u679c\u4e0d\u8bbe\u7f6emaxmemory\u6216\u8005\u8bbe\u7f6e\u4e3a0\uff0c64\u4f4d\u7cfb\u7edf\u4e0d\u9650\u5236\u5185\u5b58\uff0c32\u4f4d\u7cfb\u7edf\u6700\u591a\u4f7f\u75283GB\u5185\u5b58\u3002\n<\/p>\n<p style=\"margin-top:0px;margin-bottom:0.75em;font-size:16px;line-height:27.2px;text-indent:1em;color:#333333;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;white-space:normal;background-color:#FEFEFE;\">\n\tLRU\u662fLeast Recently Used \u8fd1\u671f\u6700\u5c11\u4f7f\u7528\u7b97\u6cd5\u3002\n<\/p>\n<ol style=\"padding:0px;margin:0px 0px 0.75em 25px;font-size:16px;line-height:27.2px;color:#333333;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;white-space:normal;background-color:#FEFEFE;\">\n<li style=\"line-height:1.7em;\">\n\t\tvolatile-lru -&gt; \u6839\u636eLRU\u7b97\u6cd5\u751f\u6210\u7684\u8fc7\u671f\u65f6\u95f4\u6765\u5220\u9664\u3002\n\t<\/li>\n<li style=\"line-height:1.7em;\">\n\t\tallkeys-lru -&gt; \u6839\u636eLRU\u7b97\u6cd5\u5220\u9664\u4efb\u4f55key\u3002\n\t<\/li>\n<li style=\"line-height:1.7em;\">\n\t\tvolatile-random -&gt; \u6839\u636e\u8fc7\u671f\u8bbe\u7f6e\u6765\u968f\u673a\u5220\u9664key\u3002\n\t<\/li>\n<li style=\"line-height:1.7em;\">\n\t\tallkeys-&gt;random -&gt; \u65e0\u5dee\u522b\u968f\u673a\u5220\u3002\n\t<\/li>\n<li style=\"line-height:1.7em;\">\n\t\tvolatile-ttl -&gt; \u6839\u636e\u6700\u8fd1\u8fc7\u671f\u65f6\u95f4\u6765\u5220\u9664\uff08\u8f85\u4ee5TTL\uff09\n\t<\/li>\n<li style=\"line-height:1.7em;\">\n\t\tnoeviction -&gt; \u8c01\u4e5f\u4e0d\u5220\uff0c\u76f4\u63a5\u5728\u5199\u64cd\u4f5c\u65f6\u8fd4\u56de\u9519\u8bef\u3002\n\t<\/li>\n<\/ol>\n<p style=\"margin-top:0px;margin-bottom:0.75em;font-size:16px;line-height:27.2px;text-indent:1em;color:#333333;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;white-space:normal;background-color:#FEFEFE;\">\n\t\u5982\u679c\u8bbe\u7f6e\u4e86maxmemory\uff0c\u4e00\u822c\u90fd\u8981\u8bbe\u7f6e\u8fc7\u671f\u7b56\u7565\u3002\u6253\u5f00Redis\u7684\u914d\u7f6e\u6587\u4ef6\u6709\u5982\u4e0b\u63cf\u8ff0\uff0cRedis\u6709\u516d\u79cd\u8fc7\u671f\u7b56\u7565\uff1a\n<\/p>\n<div style=\"font-size:16px;line-height:27.2px;color:#333333;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;white-space:normal;background-color:#FEFEFE;\">\n<pre class=\"prettyprint hljs makefile\" style=\"padding:0.5em;font-family:Menlo, Monaco, Consolas, 'Courier New', monospace;color:#444444;border-radius:4px;margin-top:0px;margin-bottom:1.5em;font-size:14px;line-height:1.5em;word-break:break-all;word-wrap:break-word;border:none;overflow-x:auto;background-color:#F6F6F6;\"><span class=\"hljs-comment\" style=\"color:#888888;\"># volatile-lru -&gt; removethekeywithanexpireset usinganLRUalgorithm<\/span> <span class=\"hljs-comment\" style=\"color:#888888;\"># allkeys-lru -&gt; removeanykeyaccordinglytotheLRUalgorithm<\/span> <span class=\"hljs-comment\" style=\"color:#888888;\"># volatile-random -&gt; remove a randomkeywithanexpireset<\/span> <span class=\"hljs-comment\" style=\"color:#888888;\"># allkeys-random -&gt; remove a randomkey, anykey<\/span> <span class=\"hljs-comment\" style=\"color:#888888;\"># volatile-ttl -&gt; removethekeywiththenearestexpiretime (minorTTL)<\/span> <span class=\"hljs-comment\" style=\"color:#888888;\"># noeviction -&gt; don't expireatall, justreturn anerroronwriteoperations<\/span> <\/pre>\n<\/div>\n<p style=\"margin-top:0px;margin-bottom:0.75em;font-size:16px;line-height:27.2px;text-indent:1em;color:#333333;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;white-space:normal;background-color:#FEFEFE;\">\n\t\u90a3\u4e48\u6253\u5f00\u914d\u7f6e\u6587\u4ef6\uff0c\u6dfb\u52a0\u5982\u4e0b\u4e00\u884c\uff0c\u4f7f\u7528volatile-lru\u7684\u8fc7\u671f\u7b56\u7565\uff1a\n<\/p>\n<div style=\"font-size:16px;line-height:27.2px;color:#333333;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;white-space:normal;background-color:#FEFEFE;\">\n<pre class=\"hljs\" style=\"padding:0.5em;font-family:Menlo, Monaco, Consolas, 'Courier New', monospace;color:#444444;border-radius:4px;margin-top:0px;margin-bottom:0.75em;font-size:14px;line-height:1.5em;word-break:break-all;word-wrap:break-word;border:none;overflow-x:auto;background-color:#F6F6F6;\">maxmemory-policyvolatile-lru\r\n<\/pre>\n<\/div>\n<p style=\"margin-top:0px;margin-bottom:0.75em;font-size:16px;line-height:27.2px;text-indent:1em;color:#333333;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;white-space:normal;background-color:#FEFEFE;\">\n\t\u4fdd\u5b58\u6587\u4ef6\u9000\u51fa\uff0c\u91cd\u542fredis\u670d\u52a1\u3002\n<\/p>\n<h3 style=\"margin:0px 0px 0.5em;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;line-height:1.6em;color:#333333;text-rendering:optimizeLegibility;font-size:18px;text-indent:1em;white-space:normal;background-color:#FEFEFE;\"><span class=\"ez-toc-section\" id=\"info%E5%91%BD%E4%BB%A4%E6%9F%A5%E7%9C%8BRedis%E5%86%85%E5%AD%98%E4%BD%BF%E7%94%A8%E6%83%85%E5%86%B5\"><\/span>\n\tinfo\u547d\u4ee4\u67e5\u770bRedis\u5185\u5b58\u4f7f\u7528\u60c5\u51b5<br \/>\n<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"margin-top:0px;margin-bottom:0.75em;font-size:16px;line-height:27.2px;text-indent:1em;color:#333333;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;white-space:normal;background-color:#FEFEFE;\">\n\t\u5982\u670d\u52a1\u5668Redis\u6240\u5728\u76ee\u5f55\uff1a\/usr\/local\/redis-3.0.7\/src\n<\/p>\n<p style=\"margin-top:0px;margin-bottom:0.75em;font-size:16px;line-height:27.2px;text-indent:1em;color:#333333;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;white-space:normal;background-color:#FEFEFE;\">\n\t\u5728\u7ec8\u7aef\u8f93\u5165.\/redis-cli\uff0c\u6253\u5f00Redis\u5ba2\u6237\u7aef\uff0c\u8f93\u5165INFO\u547d\u4ee4\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p style=\"margin-top:0px;margin-bottom:0.75em;font-size:16px;line-height:27.2px;text-indent:1em;color:#333333;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;white-space:normal;background-color:#FEFEFE;\"><span style=\"color:#999999;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;font-size:14px;line-height:21px;white-space:normal;float:left;background-color:#FEFEFE;\">\u539f\u6587<\/span><span style=\"color:#999999;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;font-size:14px;line-height:21px;white-space:normal;background-color:#FEFEFE;\">&nbsp;&nbsp;<\/span><a class=\"cut cut70\" href=\"http:\/\/blog.tanteng.me\/2016\/03\/redis-maxmemory\/?utm_source=tuicool&amp;utm_medium=referral\" style=\"color:#333333;text-decoration:none;transition:0.25s;outline:none 0px;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;max-width:69%;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;font-size:14px;line-height:21px;display:inline-block;background-color:#FEFEFE;\">http:\/\/blog.tanteng.me\/2016\/03\/redis-maxmemory\/<\/a><\/p>\n<p style=\"margin-top:0px;margin-bottom:0.75em;font-size:16px;line-height:27.2px;text-indent:1em;color:#333333;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;white-space:normal;background-color:#FEFEFE;\">\n\tRedis\u9700\u8981\u8bbe\u7f6e\u6700\u5927\u5360\u7528\u5185\u5b58\u5417\uff1f\u5982\u679cRedis\u5185\u5b58\u4f7f\u7528\u8d85\u51fa\u4e86\u8bbe\u7f6e\u7684\u6700\u5927\u503c\u4f1a\u600e\u6837\uff1f\n<\/p>\n<h3 style=\"margin:0px 0px 0.5em;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;line-height:1.6em;color:#333333;text-rendering:optimizeLegibility;font-size:18px;text-indent:1em;white-space:normal;background-color:#FEFEFE;\">\n\t\u8bbe\u7f6eRedis\u6700\u5927\u5360\u7528\u5185\u5b58<br \/>\n<\/h3>\n<p style=\"margin-top:0px;margin-bottom:0.75em;font-size:16px;line-height:27.2px;text-indent:1em;color:#333333;font-family:'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', \u5fae\u8f6f\u96c5\u9ed1, sans-serif;white-space:normal;background-color:#FEFEFE;\">\n\tRedis\u8bbe\u7f6e\u6700\u5927\u5360\u7528\u5185\u5b58\uff0c\u6253\u5f00redis\u914d\u7f6e\u6587\u4ef6\uff0c\u627e\u5230\u5982\u4e0b\u6bb5\u843d\uff0c\u8bbe\u7f6emaxmemory\u53c2\u6570\uff0cmaxmemory\u662fbytes\u5b57\u8282\u7c7b\u578b\uff0c\u6ce8\u610f\u8f6c\u6362\u3002&#8230;<\/p>\n","protected":false},"author":1,"featured_media":576,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[337],"tags":[],"class_list":["post-212","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[\u8f6c]\u8bbe\u7f6eRedis\u6700\u5927\u5360\u7528\u5185\u5b58 - Wayne&#039;s Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/weizn.net\/?p=212\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[\u8f6c]\u8bbe\u7f6eRedis\u6700\u5927\u5360\u7528\u5185\u5b58 - Wayne&#039;s Blog\" \/>\n<meta property=\"og:description\" content=\"\u539f\u6587&nbsp;&nbsp;http:\/\/blog.tanteng.me\/2016\/03\/redis-maxmemory\/  Redis\u9700\u8981\u8bbe\u7f6e\u6700\u5927\u5360\u7528\u5185\u5b58\u5417\uff1f\u5982\u679cRedis\u5185\u5b58\u4f7f\u7528\u8d85\u51fa\u4e86\u8bbe\u7f6e\u7684\u6700\u5927\u503c\u4f1a\u600e\u6837\uff1f   \u8bbe\u7f6eRedis\u6700\u5927\u5360\u7528\u5185\u5b58   Redis\u8bbe\u7f6e\u6700\u5927\u5360\u7528\u5185\u5b58\uff0c\u6253\u5f00redis\u914d\u7f6e\u6587\u4ef6\uff0c\u627e\u5230\u5982\u4e0b\u6bb5\u843d\uff0c\u8bbe\u7f6emaxmemory\u53c2\u6570\uff0cmaxmemory\u662fbytes\u5b57\u8282\u7c7b\u578b\uff0c\u6ce8\u610f\u8f6c\u6362\u3002...\" \/>\n<meta property=\"og:url\" content=\"http:\/\/weizn.net\/?p=212\" \/>\n<meta property=\"og:site_name\" content=\"Wayne&#039;s Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-01-22T02:43:14+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"zinan\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"http:\/\/weizn.net\/#website\",\"url\":\"http:\/\/weizn.net\/\",\"name\":\"Wayne&#039;s Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/weizn.net\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"ImageObject\",\"@id\":\"http:\/\/weizn.net\/?p=212#primaryimage\",\"inLanguage\":\"zh-Hans\",\"url\":\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/10\/1_77vo1rfq-5dclkdehbb2-a.png\",\"contentUrl\":\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/10\/1_77vo1rfq-5dclkdehbb2-a.png\",\"width\":2000,\"height\":1000},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/weizn.net\/?p=212#webpage\",\"url\":\"http:\/\/weizn.net\/?p=212\",\"name\":\"[\\u8f6c]\\u8bbe\\u7f6eRedis\\u6700\\u5927\\u5360\\u7528\\u5185\\u5b58 - Wayne&#039;s Blog\",\"isPartOf\":{\"@id\":\"http:\/\/weizn.net\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/weizn.net\/?p=212#primaryimage\"},\"datePublished\":\"2017-01-22T02:43:14+00:00\",\"dateModified\":\"2017-01-22T02:43:14+00:00\",\"breadcrumb\":{\"@id\":\"http:\/\/weizn.net\/?p=212#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/weizn.net\/?p=212\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/weizn.net\/?p=212#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\\u9996\\u9875\",\"item\":\"http:\/\/weizn.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[\\u8f6c]\\u8bbe\\u7f6eRedis\\u6700\\u5927\\u5360\\u7528\\u5185\\u5b58\"}]},{\"@type\":\"Article\",\"@id\":\"http:\/\/weizn.net\/?p=212#article\",\"isPartOf\":{\"@id\":\"http:\/\/weizn.net\/?p=212#webpage\"},\"author\":{\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\"},\"headline\":\"[\\u8f6c]\\u8bbe\\u7f6eRedis\\u6700\\u5927\\u5360\\u7528\\u5185\\u5b58\",\"datePublished\":\"2017-01-22T02:43:14+00:00\",\"dateModified\":\"2017-01-22T02:43:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/weizn.net\/?p=212#webpage\"},\"wordCount\":123,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\"},\"image\":{\"@id\":\"http:\/\/weizn.net\/?p=212#primaryimage\"},\"thumbnailUrl\":\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/10\/1_77vo1rfq-5dclkdehbb2-a.png\",\"articleSection\":[\"\\u6570\\u636e\\u5206\\u6790\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/weizn.net\/?p=212#respond\"]}]},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\",\"name\":\"zinan\",\"logo\":{\"@id\":\"http:\/\/weizn.net\/#personlogo\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[\u8f6c]\u8bbe\u7f6eRedis\u6700\u5927\u5360\u7528\u5185\u5b58 - Wayne&#039;s Blog","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":"http:\/\/weizn.net\/?p=212","og_locale":"zh_CN","og_type":"article","og_title":"[\u8f6c]\u8bbe\u7f6eRedis\u6700\u5927\u5360\u7528\u5185\u5b58 - Wayne&#039;s Blog","og_description":"\u539f\u6587&nbsp;&nbsp;http:\/\/blog.tanteng.me\/2016\/03\/redis-maxmemory\/  Redis\u9700\u8981\u8bbe\u7f6e\u6700\u5927\u5360\u7528\u5185\u5b58\u5417\uff1f\u5982\u679cRedis\u5185\u5b58\u4f7f\u7528\u8d85\u51fa\u4e86\u8bbe\u7f6e\u7684\u6700\u5927\u503c\u4f1a\u600e\u6837\uff1f   \u8bbe\u7f6eRedis\u6700\u5927\u5360\u7528\u5185\u5b58   Redis\u8bbe\u7f6e\u6700\u5927\u5360\u7528\u5185\u5b58\uff0c\u6253\u5f00redis\u914d\u7f6e\u6587\u4ef6\uff0c\u627e\u5230\u5982\u4e0b\u6bb5\u843d\uff0c\u8bbe\u7f6emaxmemory\u53c2\u6570\uff0cmaxmemory\u662fbytes\u5b57\u8282\u7c7b\u578b\uff0c\u6ce8\u610f\u8f6c\u6362\u3002...","og_url":"http:\/\/weizn.net\/?p=212","og_site_name":"Wayne&#039;s Blog","article_published_time":"2017-01-22T02:43:14+00:00","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"zinan","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"http:\/\/weizn.net\/#website","url":"http:\/\/weizn.net\/","name":"Wayne&#039;s Blog","description":"","publisher":{"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/weizn.net\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"ImageObject","@id":"http:\/\/weizn.net\/?p=212#primaryimage","inLanguage":"zh-Hans","url":"http:\/\/weizn.net\/wp-content\/uploads\/2020\/10\/1_77vo1rfq-5dclkdehbb2-a.png","contentUrl":"http:\/\/weizn.net\/wp-content\/uploads\/2020\/10\/1_77vo1rfq-5dclkdehbb2-a.png","width":2000,"height":1000},{"@type":"WebPage","@id":"http:\/\/weizn.net\/?p=212#webpage","url":"http:\/\/weizn.net\/?p=212","name":"[\u8f6c]\u8bbe\u7f6eRedis\u6700\u5927\u5360\u7528\u5185\u5b58 - Wayne&#039;s Blog","isPartOf":{"@id":"http:\/\/weizn.net\/#website"},"primaryImageOfPage":{"@id":"http:\/\/weizn.net\/?p=212#primaryimage"},"datePublished":"2017-01-22T02:43:14+00:00","dateModified":"2017-01-22T02:43:14+00:00","breadcrumb":{"@id":"http:\/\/weizn.net\/?p=212#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["http:\/\/weizn.net\/?p=212"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/weizn.net\/?p=212#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"http:\/\/weizn.net\/"},{"@type":"ListItem","position":2,"name":"[\u8f6c]\u8bbe\u7f6eRedis\u6700\u5927\u5360\u7528\u5185\u5b58"}]},{"@type":"Article","@id":"http:\/\/weizn.net\/?p=212#article","isPartOf":{"@id":"http:\/\/weizn.net\/?p=212#webpage"},"author":{"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264"},"headline":"[\u8f6c]\u8bbe\u7f6eRedis\u6700\u5927\u5360\u7528\u5185\u5b58","datePublished":"2017-01-22T02:43:14+00:00","dateModified":"2017-01-22T02:43:14+00:00","mainEntityOfPage":{"@id":"http:\/\/weizn.net\/?p=212#webpage"},"wordCount":123,"commentCount":0,"publisher":{"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264"},"image":{"@id":"http:\/\/weizn.net\/?p=212#primaryimage"},"thumbnailUrl":"http:\/\/weizn.net\/wp-content\/uploads\/2020\/10\/1_77vo1rfq-5dclkdehbb2-a.png","articleSection":["\u6570\u636e\u5206\u6790"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/weizn.net\/?p=212#respond"]}]},{"@type":["Person","Organization"],"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264","name":"zinan","logo":{"@id":"http:\/\/weizn.net\/#personlogo"}}]}},"_links":{"self":[{"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/posts\/212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=212"}],"version-history":[{"count":0,"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/posts\/212\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/media\/576"}],"wp:attachment":[{"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=212"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}