﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-j2ee绿洲-文章分类-Redis</title><link>http://www.blogjava.net/livery/category/53156.html</link><description>找到属于自己的一片天空</description><language>zh-cn</language><lastBuildDate>Tue, 25 Dec 2012 02:20:31 GMT</lastBuildDate><pubDate>Tue, 25 Dec 2012 02:20:31 GMT</pubDate><ttl>60</ttl><item><title>redis2.4&amp;2.6改进特点列表</title><link>http://www.blogjava.net/livery/articles/393433.html</link><dc:creator>心情经纬</dc:creator><author>心情经纬</author><pubDate>Tue, 25 Dec 2012 02:19:00 GMT</pubDate><guid>http://www.blogjava.net/livery/articles/393433.html</guid><wfw:comment>http://www.blogjava.net/livery/comments/393433.html</wfw:comment><comments>http://www.blogjava.net/livery/articles/393433.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/livery/comments/commentRss/393433.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/livery/services/trackbacks/393433.html</trackback:ping><description><![CDATA[最近准备将redis升级到最新版2.6,就简单从官网上寻找了一下最近的改动点.<br />2.2-2.4的改进<br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->*&nbsp;编码sorted&nbsp;sets,&nbsp;小的soted&nbsp;sets将会使用非常小的内存<br />*&nbsp;编码数据类型(ziplists,zipmaps,intsets)的本地持久化,更多的数据sets的保存和加载速度提高了一个数量级.<br />*&nbsp;命令(SADD,HDEL,SREM,ZREM,ZADD,L/RPUSH)支持可变参数输入<br />*&nbsp;为了避免减少内存碎片,支持jemalloc(linux系统默认开启)<br />*&nbsp;保存时降低内存使用率<br />*&nbsp;更多的信息field&nbsp;(peak&nbsp;memory,&nbsp;fork&nbsp;time,&nbsp;)<br />*&nbsp;OBJECT&nbsp;命令&nbsp;支持对象自检<br />*&nbsp;CLIENT&nbsp;命令支持clients自检<br />*&nbsp;非阻塞的从-&gt;主连接<br />*&nbsp;更好的redis-cli连接处理,新的redis-cli特征<br />*&nbsp;更好的redis-benchmark,现在能benchmark用户提供的命令.<br />*&nbsp;色彩化Make命令.<br />*&nbsp;VM废弃,仍然支持,但是给出警告不要使用它.<br />*&nbsp;LRANGE优化,可以在查询一个长list的最后一部分时显著提高性能，。<br />*&nbsp;redis-cli&nbsp;现在实现了一个延迟模式来监控redis的延迟<br />*&nbsp;Hash&nbsp;type&nbsp;settings&nbsp;从INFO中移除&nbsp;(一样的信息可以通过配置GET来获取)<br />*&nbsp;在无法bind的时候&nbsp;在错误信息中包含端口号&nbsp;<br />*&nbsp;AOF&nbsp;fsync&nbsp;当fsync策略是'everysec'的时候,运行在后台.&nbsp;<br />*&nbsp;AOF&nbsp;performances&nbsp;improved&nbsp;moving&nbsp;in&nbsp;background&nbsp;a&nbsp;possibly&nbsp;slow&nbsp;close(2)&nbsp;call.<br />*&nbsp;AOF&nbsp;protocol&nbsp;synthesis&nbsp;speedup.<br />*&nbsp;新的maxmemory测试.<br />*&nbsp;redis-check-dump:&nbsp;RDB&nbsp;version&nbsp;2&nbsp;now&nbsp;supported.<br />*&nbsp;为一个uinx&nbsp;socket&nbsp;mask增加一个配置说明.<br />*&nbsp;CONFIG&nbsp;SET/GET&nbsp;设置&nbsp;loglevel.<br />*&nbsp;在/utils&nbsp;中增加redis&nbsp;&nbsp;全系统(Debian/Ubuntu)安装脚本.<br />*&nbsp;redis-cli&nbsp;现在支持单引号风格的字符串&nbsp;<br />*&nbsp;通过CONFIG&nbsp;SET&nbsp;命令关闭密码认证.<br />*&nbsp;redis.conf&nbsp;部分更好地&nbsp;better&nbsp;documented.<br />*&nbsp;客户端默认超时timeout是0,即永不超时.<br />*&nbsp;调整I/O缓存长度为了提高大负载的性能.&nbsp;<br />*&nbsp;Fixed&nbsp;crash&nbsp;on&nbsp;SPARC&nbsp;due&nbsp;to&nbsp;improper&nbsp;alighment&nbsp;due&nbsp;to&nbsp;bad&nbsp;assumptions&nbsp;about&nbsp;data&nbsp;types&nbsp;size.<br />*&nbsp;CLIENT&nbsp;LIST&nbsp;输出加强,代码重构.<br />*&nbsp;CLIENT&nbsp;LIST&nbsp;输出修改,包括客户端最后执行的命令.<br />*&nbsp;协议错误现在记录log&nbsp;loglevel&gt;=verbose.<br />*&nbsp;两个新的INFO&nbsp;field关联到AOF,对于调查redis问题非常有用.&nbsp;<br />*&nbsp;在redis的测试中实现--quiet选项<br />*&nbsp;在INFO&nbsp;中包含每个连接的slave的ip/端口/状态.&nbsp;<br />*&nbsp;在INFO&nbsp;output信息中展示GCC版本.<br />*&nbsp;redis-cli增加&nbsp;--pipe&nbsp;模式,&nbsp;see&nbsp;http://redis.io/topics/mass-insert<br />*&nbsp;更好地改进失效key收集算法,当大量keys在同时失效的时候,&nbsp;使得server响应性能更快.&nbsp;<br />*&nbsp;INFO&nbsp;命令展示slaves(包括端口号)&nbsp;建议使用2.4.16以上的版本作slave<br />&nbsp;This&nbsp;makes&nbsp;Redis&nbsp;2.4.16&nbsp;compatible&nbsp;with&nbsp;Redis&nbsp;Sentinel.&nbsp;This&nbsp;fix&nbsp;required&nbsp;the&nbsp;introduction&nbsp;of&nbsp;a&nbsp;new&nbsp;internal&nbsp;command&nbsp;called&nbsp;REPLCONF,&nbsp;see&nbsp;commit&nbsp;b998ebe&nbsp;for&nbsp;more&nbsp;information.<br />*&nbsp;INFO&nbsp;命令现在包含run_id字段保证Redis&nbsp;Sentinel的兼容性&nbsp;<br />*&nbsp;支持参数'slave&nbsp;priority'&nbsp;通过INFO发布,主要用于Redis&nbsp;Sentinel.</div>2.4-2.6的改进<br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->*&nbsp;SORT现在会拒绝无法转换为数字的数字模型元素进行排序<br />*&nbsp;EXPIREs现在支持微秒失效.&nbsp;(but&nbsp;this&nbsp;is&nbsp;very&nbsp;unlikely&nbsp;to<br />&nbsp;&nbsp;break&nbsp;code&nbsp;that&nbsp;was&nbsp;not&nbsp;conceived&nbsp;exploting&nbsp;the&nbsp;previous&nbsp;resolution&nbsp;error<br />&nbsp;&nbsp;in&nbsp;some&nbsp;way.)<br />*&nbsp;INFO输出现在一点不同,包含空line和'#'开通的注释.所有主流的客户端现在已经支持新的INFO格式.<br />*&nbsp;Slaves&nbsp;现在默认是只读模式(但是可以通过修改配置文件red&nbsp;is.conf的'slave-read-only'项&nbsp;为'no'&nbsp;来取消只读&nbsp;,或者使用CONFIG&nbsp;SET来取消).<br /><br />下面的INFO&nbsp;&nbsp;field为了一致性调整了名字:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;changes_since_last_save&nbsp;-&gt;&nbsp;rdb_changes_since_last_save<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bgsave_in_progress&nbsp;-&gt;&nbsp;rdb_bgsave_in_progress<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;last_save_time&nbsp;-&gt;&nbsp;rdb_last_save_time<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;last_bgsave_status&nbsp;-&gt;&nbsp;rdb_last_bgsave_status<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bgrewriteaof_in_progress&nbsp;-&gt;&nbsp;aof_rewrite_in_progress<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bgrewriteaof_scheduled&nbsp;-&gt;&nbsp;aof_rewrite_scheduled<br /><br />下面的redis.conf配置文件和&nbsp;CONFIG&nbsp;GET&nbsp;/&nbsp;SET&nbsp;参数做了调整:<br />&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;hash-max-zipmap-entries,&nbsp;替换为&nbsp;hash-max-ziplist-entries<br />&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;hash-max-zipmap-value,&nbsp;替换为&nbsp;hash-max-ziplist-value<br />&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;glueoutputbuf&nbsp;option&nbsp;现在已经完全废弃&nbsp;(was&nbsp;deprecated)<br /><br />*&nbsp;Server&nbsp;端支持Lua脚本,&nbsp;see&nbsp;http://redis.io/commands/eval<br />*&nbsp;Virtual&nbsp;Memory&nbsp;完全去掉(was&nbsp;deprecated&nbsp;in&nbsp;2.4)<br />*&nbsp;关于客户端最大数量限制的硬编码去掉.<br />*&nbsp;AOF&nbsp;低级的语义更明智,尤其是使用在slaves中的时候.&nbsp;<br />*&nbsp;微秒级的expires,也增加了一些新的命令(PEXPIRE,PTTL,&#8230;)&nbsp;.<br />*&nbsp;为了小集合(lists,ziplists和hashes里只包含小integer的时候)提供更好的内存使用率.&nbsp;*&nbsp;slaves只读.<br />*&nbsp;新增位操作:&nbsp;BITCOUNT&nbsp;和&nbsp;BITOP&nbsp;命令.<br />*&nbsp;客户端最大输出缓存的软件限制和硬件限制.可以根据不同的客户端类型(normal,pubsub,slave)来指定不同的限制.&nbsp;<br />*更多地增量过期(减少阻塞)的过期key收集算法&nbsp;,当非常多的key在同一时间失效的时候,意味着redis可以提高响应的数据.<br />*&nbsp;AOF&nbsp;is&nbsp;now&nbsp;able&nbsp;to&nbsp;rewrite&nbsp;aggregate&nbsp;data&nbsp;types&nbsp;using&nbsp;variadic&nbsp;commands,<br />&nbsp;&nbsp;often&nbsp;producing&nbsp;an&nbsp;AOF&nbsp;that&nbsp;is&nbsp;faster&nbsp;to&nbsp;save,&nbsp;load,&nbsp;and&nbsp;is&nbsp;smaller&nbsp;in&nbsp;size.<br />*&nbsp;Every&nbsp;redis.conf&nbsp;directive&nbsp;is&nbsp;now&nbsp;accepted&nbsp;as&nbsp;a&nbsp;command&nbsp;line&nbsp;option&nbsp;for&nbsp;the<br />&nbsp;&nbsp;redis-server&nbsp;binary,&nbsp;with&nbsp;the&nbsp;same&nbsp;name&nbsp;and&nbsp;number&nbsp;of&nbsp;arguments.<br />*&nbsp;为了减少碰撞攻击,hash表的种子采用随机产生<br />*&nbsp;写大量object到red&nbsp;is的性能提高<br />*&nbsp;集成内存测试.见命令:redis-server&nbsp;--test-memory.<br />*&nbsp;INCRBYFLOAT&nbsp;和&nbsp;HINCRBYFLOAT命令<br />*&nbsp;新的命令&nbsp;DUMP,&nbsp;RESTORE,&nbsp;MIGRATE(从&nbsp;Redis&nbsp;Cluster&nbsp;移植到&nbsp;2.6).<br />*&nbsp;CRC64&nbsp;校验&nbsp;in&nbsp;RDB&nbsp;files.<br />*&nbsp;更好的监控输出log(现在命令在执行前记录log)&nbsp;<br />*&nbsp;"Software&nbsp;Watchdog"&nbsp;feature&nbsp;to&nbsp;debug&nbsp;latency&nbsp;issues.<br />*&nbsp;启动时增加Redis的ASCII码的艺术logo标记.<br />*&nbsp;内存冲突的崩溃报告&nbsp;或者失败断言&nbsp;使得调试定位bug的困难程度得到一定地降低&nbsp;.<br />*&nbsp;redis-benchmark&nbsp;增强:&nbsp;运行选择的测试,CSV输出,更快,更好的help<br />*&nbsp;redis-cli&nbsp;增强:&nbsp;--eval&nbsp;&nbsp;lua脚本的开发&nbsp;<br />*&nbsp;SHUTDOWN&nbsp;现在支持两个可选参数&nbsp;'SAVE'&nbsp;和&nbsp;'NOSAVE'&nbsp;.<br />*&nbsp;INFO&nbsp;输出分解为几个部分,这个命令可以指定输出某个部分.&nbsp;<br />*&nbsp;增加新的统计,一个命令被调用了多少次,被执行了多少时间(INFO&nbsp;commandstats)&nbsp;.<br />*&nbsp;More&nbsp;predictable&nbsp;SORT&nbsp;behavior&nbsp;in&nbsp;edge&nbsp;cases.<br />*&nbsp;Build模块代码改进.<br />*&nbsp;现在当slave-serve-stale-data&nbsp;设置为yes并且master挂掉的时候,&nbsp;&nbsp;代替报告一个通常的错误的red&nbsp;is回复&nbsp;&nbsp;-MASTERDOWN&nbsp;&nbsp;<br />Now&nbsp;when&nbsp;slave-serve-stale-data&nbsp;is&nbsp;set&nbsp;to&nbsp;yes&nbsp;and&nbsp;the&nbsp;master&nbsp;is&nbsp;down,&nbsp;instead&nbsp;of&nbsp;reporting&nbsp;a&nbsp;generic&nbsp;error&nbsp;Redis&nbsp;replies&nbsp;with&nbsp;-MASTERDOWN.</div><br /><br /><img src ="http://www.blogjava.net/livery/aggbug/393433.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/livery/" target="_blank">心情经纬</a> 2012-12-25 10:19 <a href="http://www.blogjava.net/livery/articles/393433.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>