设为首页 加入收藏

TOP

redis配置文件redis.conf详细说明(四)
2015-11-21 01:44:59 来源: 作者: 【 】 浏览:1
Tags:redis 配置 文件 redis.conf 详细 说明
ge-size
# Redis swap files is split into pages. An object can be saved using multiple # contiguous pages, but pages can't be shared between different objects. # So if your page is too big, small objects swapped out on disk will waste # a lot of space. If you page is too small, there is less space in the swap # file (assuming you configured the same number of total swap file pages). # # If you use a lot of small objects, use a page size of 64 or 32 bytes. # If you use a lot of big objects, use a bigger page size. # If unsure, use the default # 设置虚拟内存的页大小,如果你的value值比较大,比如说你要在value中放置博客、 # 新闻之类的所有文章内容,就设大一点,如果要放置的都是很小的内容,那就设小一点 vm-page-size 32

23、vm-pages

# Number of total memory pages in the swap file. # Given that the page table (a bitmap of free/used pages) is taken in memory, # every 8 pages on disk will consume 1 byte of RAM. # # The total swap size is vm-page-size * vm-pages # # With the default of 32-bytes memory pages and 134217728 pages Redis will # use a 4 GB swap file, that will use 16 MB of RAM for the page table. # # It's better to use the smallest acceptable value for your application, # but the default is large in order to work in most conditions. # 设置交换文件的总的 page 数量, # 需要注意的是,page table信息会放在物理内存中,每8个page就会占据RAM中的1个byte。 # 总的虚拟内存大小 = vm-page-size * vm-pages vm-pages 134217728

24、vm-max-threads

# Max number of VM I/O threads running at the same time. # This threads are used to read/write data from/to swap file, since they # also encode and decode objects from disk to memory or the reverse, a bigger # number of threads can help with big objects even if they can't help with # I/O itself as the physical device may not be able to couple with many # reads/writes operations at the same time. # # The special value of 0 turn off threaded I/O and enables the blocking # Virtual Memory implementation. # 设置 VM IO 同时使用的线程数量。 vm-max-threads 4

25、hash-max-zipmap

# Hashes are encoded in a special way (much more memory efficient) when they # have at max a given numer of elements, and the biggest element does not # exceed a given threshold. You can configure this limits with the following # configuration directives. # redis 2.0 中引入了 hash 数据结构。 # hash中包含超过指定元素个数并且最大的元素当没有超过临界时, # hash 将以zipmap(又称为 small hash大大减少内存使用)来存储,这里可以设置这两个临界值 hash-max-zipmap-entries 512 hash-max-zipmap-value 64

26、activerehashing

# Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in # order to help rehashing the main Redis hash table (the one mapping top-level # keys to values). The hash table implementation redis uses (see dict.c) # performs a lazy rehashing: the more operation you run into an hash table # that is rhashing, the more rehashing "steps" are performed, so if the # server is idle the rehashing is never complete and some more memory is used # by the hash table. # # The default is to use this millisecond 10 times every second in order to # active rehashing the main dictionaries, freeing memory when possible. # # If unsure: # use "activerehashing no" if you have hard latency requirements and it is # not a good thing in your environment that Redis can reply form time to time # to queries with 2 milliseconds delay. # # use "activerehashing yes" if you don't have such hard requirements but # want to free memory asap when possible. # 开启之后, redis将在每100毫秒时使用1毫秒的CPU时间来对redis的hash表进行重新hash, # 可以降低内存的使用。 # 当你的使用场景中,有非常严格的实时性需要,不能够接受Redis时不时的对请求有2毫秒的延迟的话, # 把这项配置为 no。 # 如果没有这么严格的实时性要求,可以设置为 yes,以便能够尽可能快的释放内存 activerehashing yes
首页 上一页 1 2 3 4 下一页 尾页 4/4/4
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇机房重构――存储过程 下一篇错误代码:1327Undeclaredvariabl..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: