精华内容
下载资源
问答
  • NSGA-II 中文版注释

    2017-11-30 15:36:25
    NSGA-II 带中文版注释,MATLAB小白逐字逐句翻译注释,和刚才的是两个版本,但是中心思想是一样的
  • NSGA-II 带中文版注释

    2017-11-30 15:23:12
    NSGA-II 带中文版注释,MATLAB小白逐字逐句翻译注释,应该没有比这个更全得了,
  • NSGA-II 带中文版注释,如有需要,请大家下载!!!!!
  • iPhone8 Plus手机电路图中文版注释-总共81页,带中文版注释,适合方便分析,学习,带有苹果商标的,适合硬件开发工程师查看,苹果店维修人员查看,也适合高手查看,绝对的干货
  • Dojo 1.7 中文版本注释功能说明,以Dojo使用案例,很经典,做为系统了解Dojo功能及用法很有用!
  • 微软SQLHelper全英文写的对数据库各种操作类和方法都封装好了!
  • redis.conf中文版注释

    2012-09-25 13:18:00
    # 注意,异步导出的数据库文件和纯累加文件可以并存(你得把上面所有"save"设置都注释掉,关掉导出机制)。 # 如果纯累加模式开启了,那么Redis会在启动时载入日志文件而忽略导出的 dump.rdb 文件。 # # 重要:查看 ...

    # Redis示例配置文件

    # 注意单位问题:当需要设置内存大小的时候,可以使用类似1k、5GB、4M这样的常见格式:
    #
    # 1k => 1000 bytes
    # 1kb => 1024 bytes
    # 1m => 1000000 bytes
    # 1mb => 1024*1024 bytes
    # 1g => 1000000000 bytes
    # 1gb => 1024*1024*1024 bytes
    #
    # 单位是大小写不敏感的,所以1GB 1Gb 1gB的写法都是完全一样的。

    # Redis默认是不作为守护进程来运行的。你可以把这个设置为"yes"让它作为守护进程来运行。
    # 注意,当作为守护进程的时候,Redis会把进程ID写到 /var/run/redis.pid
    daemonize no

    # 当以守护进程方式运行的时候,Redis会把进程ID默认写到 /var/run/redis.pid。你可以在这里修改路径。
    pidfile /var/run/redis.pid

    # 接受连接的特定端口,默认是6379。
    # 如果端口设置为0,Redis就不会监听TCP套接字。
    port 6379

    # 如果你想的话,你可以绑定单一接口;如果这里没单独设置,那么所有接口的连接都会被监听。
    #
    # bind 127.0.0.1

    # 指定用来监听连接的unxi套接字的路径。这个没有默认值,所以如果你不指定的话,Redis就不会通过unix套接字来监听。
    #
    # unixsocket /tmp/redis.sock
    # unixsocketperm 755

    #一个客户端空闲多少秒后关闭连接。(0代表禁用,永不关闭)
    timeout 0

    # 设置服务器调试等级。
    # 可能值:
    # debug (很多信息,对开发/测试有用)
    # verbose (很多精简的有用信息,但是不像debug等级那么多)
    # notice (适量的信息,基本上是你生产环境中需要的程度)
    # warning (只有很重要/严重的信息会记录下来)
    loglevel verbose

    # 指明日志文件名。也可以使用"stdout"来强制让Redis把日志信息写到标准输出上。
    # 注意:如果Redis以守护进程方式运行,而你设置日志显示到标准输出的话,那么日志会发送到 /dev/null
    logfile stdout

    # 要使用系统日志记录器很简单,只要设置 "syslog-enabled" 为 "yes" 就可以了。
    # 然后根据需要设置其他一些syslog参数就可以了。
    # syslog-enabled no

    # 指明syslog身份
    # syslog-ident redis

    # 指明syslog的设备。必须是一个用户或者是 LOCAL0 ~ LOCAL7 之一。
    # syslog-facility local0

    # 设置数据库个数。默认数据库是 DB 0,你可以通过SELECT <dbid> WHERE dbid(0~'databases' - 1)来为每个连接使用不同的数据库。
    databases 16

    ################################ 快照 #################################

    #
    # 把数据库存到磁盘上:
    #
    # save <seconds> <changes>
    #
    # 会在指定秒数和数据变化次数之后把数据库写到磁盘上。
    #
    # 下面的例子将会进行把数据写入磁盘的操作:
    # 900秒(15分钟)之后,且至少1次变更
    # 300秒(5分钟)之后,且至少10次变更
    # 60秒之后,且至少10000次变更
    #
    # 注意:你要想不写磁盘的话就把所有 "save" 设置注释掉就行了。

    save 900 1
    save 300 10
    save 60 10000

    # 当导出到 .rdb 数据库时是否用LZF压缩字符串对象。
    # 默认设置为 "yes",所以几乎总是生效的。
    # 如果你想节省CPU的话你可以把这个设置为 "no",但是如果你有可压缩的key的话,那数据文件就会更大了。
    rdbcompression yes

    # 数据库的文件名
    dbfilename dump.rdb

    # 工作目录
    #
    # 数据库会写到这个目录下,文件名就是上面的 "dbfilename" 的值。
    #
    # 累加文件也放这里。
    #
    # 注意你这里指定的必须是目录,不是文件名。
    dir ./

    ################################# 同步 #################################

    #
    # 主从同步。通过 slaveof 配置来实现Redis实例的备份。
    # 注意,这里是本地从远端复制数据。也就是说,本地可以有不同的数据库文件、绑定不同的IP、监听不同的端口。
    #
    # slaveof <masterip> <masterport>

    # 如果master设置了密码(通过下面的 "requirepass" 选项来配置),那么slave在开始同步之前必须进行身份验证,否则它的同步请求会被拒绝。
    #
    # masterauth <master-password>

    # 当一个slave失去和master的连接,或者同步正在进行中,slave的行为有两种可能:
    #
    # 1) 如果 slave-serve-stale-data 设置为 "yes" (默认值),slave会继续响应客户端请求,可能是正常数据,也可能是还没获得值的空数据。
    # 2) 如果 slave-serve-stale-data 设置为 "no",slave会回复"正在从master同步(SYNC with master in progress)"来处理各种请求,除了 INFO 和 SLAVEOF 命令。
    #
    slave-serve-stale-data yes

    # slave根据指定的时间间隔向服务器发送ping请求。
    # 时间间隔可以通过 repl_ping_slave_period 来设置。
    # 默认10秒。
    #
    # repl-ping-slave-period 10

    # 下面的选项设置了大块数据I/O、向master请求数据和ping响应的过期时间。
    # 默认值60秒。
    #
    # 一个很重要的事情是:确保这个值比 repl-ping-slave-period 大,否则master和slave之间的传输过期时间比预想的要短。
    #
    # repl-timeout 60

    ################################## 安全 ###################################

    # 要求客户端在处理任何命令时都要验证身份和密码。
    # 这在你信不过来访者时很有用。
    #
    # 为了向后兼容的话,这段应该注释掉。而且大多数人不需要身份验证(例如:它们运行在自己的服务器上。)
    #
    # 警告:因为Redis太快了,所以居心不良的人可以每秒尝试150k的密码来试图破解密码。
    # 这意味着你需要一个高强度的密码,否则破解太容易了。
    #
    # requirepass foobared

    # 命令重命名
    #
    # 在共享环境下,可以为危险命令改变名字。比如,你可以为 CONFIG 改个其他不太容易猜到的名字,这样你自己仍然可以使用,而别人却没法做坏事了。
    #
    # 例如:
    #
    # rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52
    #
    # 甚至也可以通过给命令赋值一个空字符串来完全禁用这条命令:
    #
    # rename-command CONFIG ""

    ################################### 限制 ####################################

    #
    # 设置最多同时连接客户端数量。
    # 默认没有限制,这个关系到Redis进程能够打开的文件描述符数量。
    # 特殊值"0"表示没有限制。
    # 一旦达到这个限制,Redis会关闭所有新连接并发送错误"达到最大用户数上限(max number of clients reached)"
    #
    # maxclients 128

    # 不要用比设置的上限更多的内存。一旦内存使用达到上限,Redis会根据选定的回收策略(参见:maxmemmory-policy)删除key。
    #
    # 如果因为删除策略问题Redis无法删除key,或者策略设置为 "noeviction",Redis会回复需要更多内存的错误信息给命令。
    # 例如,SET,LPUSH等等。但是会继续合理响应只读命令,比如:GET。
    #
    # 在使用Redis作为LRU缓存,或者为实例设置了硬性内存限制的时候(使用 "noeviction" 策略)的时候,这个选项还是满有用的。
    #
    # 警告:当一堆slave连上达到内存上限的实例的时候,响应slave需要的输出缓存所需内存不计算在使用内存当中。
    # 这样当请求一个删除掉的key的时候就不会触发网络问题/重新同步的事件,然后slave就会收到一堆删除指令,直到数据库空了为止。
    #
    # 简而言之,如果你有slave连上一个master的话,那建议你把master内存限制设小点儿,确保有足够的系统内存用作输出缓存。
    # (如果策略设置为"noeviction"的话就不无所谓了)
    #
    # maxmemory <bytes>

    # 内存策略:如果达到内存限制了,Redis如何删除key。你可以在下面五个策略里面选:
    #
    # volatile-lru -> 根据LRU算法生成的过期时间来删除。
    # allkeys-lru -> 根据LRU算法删除任何key。
    # volatile-random -> 根据过期设置来随机删除key。
    # allkeys->random -> 无差别随机删。
    # volatile-ttl -> 根据最近过期时间来删除(辅以TTL)
    # noeviction -> 谁也不删,直接在写操作时返回错误。
    #
    # 注意:对所有策略来说,如果Redis找不到合适的可以删除的key都会在写操作时返回一个错误。
    #
    # 这里涉及的命令:set setnx setex append
    # incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd
    # sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby
    # zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby
    # getset mset msetnx exec sort
    #
    # 默认值如下:
    #
    # maxmemory-policy volatile-lru

    # LRU和最小TTL算法的实现都不是很精确,但是很接近(为了省内存),所以你可以用样例做测试。
    # 例如:默认Redis会检查三个key然后取最旧的那个,你可以通过下面的配置项来设置样本的个数。
    #
    # maxmemory-samples 3

    ############################## 纯累加模式 ###############################

    # 默认情况下,Redis是异步的把数据导出到磁盘上。这种情况下,当Redis挂掉的时候,最新的数据就丢了。
    # 如果不希望丢掉任何一条数据的话就该用纯累加模式:一旦开启这个模式,Redis会把每次写入的数据在接收后都写入 appendonly.aof 文件。
    # 每次启动时Redis都会把这个文件的数据读入内存里。
    #
    # 注意,异步导出的数据库文件和纯累加文件可以并存(你得把上面所有"save"设置都注释掉,关掉导出机制)。
    # 如果纯累加模式开启了,那么Redis会在启动时载入日志文件而忽略导出的 dump.rdb 文件。
    #
    # 重要:查看 BGREWRITEAOF 来了解当累加日志文件太大了之后,怎么在后台重新处理这个日志文件。

    appendonly no

    # 纯累加文件名字(默认:"appendonly.aof")
    # appendfilename appendonly.aof

    # fsync() 请求操作系统马上把数据写到磁盘上,不要再等了。
    # 有些操作系统会真的把数据马上刷到磁盘上;有些则要磨蹭一下,但是会尽快去做。
    #
    # Redis支持三种不同的模式:
    #
    # no:不要立刻刷,只有在操作系统需要刷的时候再刷。比较快。
    # always:每次写操作都立刻写入到aof文件。慢,但是最安全。
    # everysec:每秒写一次。折衷方案。
    #
    # 默认的 "everysec" 通常来说能在速度和数据安全性之间取得比较好的平衡。
    # 如果你真的理解了这个意味着什么,那么设置"no"可以获得更好的性能表现(如果丢数据的话,则只能拿到一个不是很新的快照);
    # 或者相反的,你选择 "always" 来牺牲速度确保数据安全、完整。
    #
    # 如果拿不准,就用 "everysec"

    # appendfsync always
    appendfsync everysec
    # appendfsync no

    # 如果AOF的同步策略设置成 "always" 或者 "everysec",那么后台的存储进程(后台存储或写入AOF日志)会产生很多磁盘I/O开销。
    # 某些Linux的配置下会使Redis因为 fsync() 而阻塞很久。
    # 注意,目前对这个情况还没有完美修正,甚至不同线程的 fsync() 会阻塞我们的 write(2) 请求。
    #
    # 为了缓解这个问题,可以用下面这个选项。它可以在 BGSAVE 或 BGREWRITEAOF 处理时阻止 fsync()。
    #
    # 这就意味着如果有子进程在进行保存操作,那么Redis就处于"不可同步"的状态。
    # 这实际上是说,在最差的情况下可能会丢掉30秒钟的日志数据。(默认Linux设定)
    #
    # 如果你有延迟的问题那就把这个设为 "yes",否则就保持 "no",这是保存持久数据的最安全的方式。
    no-appendfsync-on-rewrite no

    # 自动重写AOF文件
    #
    # 如果AOF日志文件大到指定百分比,Redis能够通过 BGREWRITEAOF 自动重写AOF日志文件。
    #
    # 工作原理:Redis记住上次重写时AOF日志的大小(或者重启后没有写操作的话,那就直接用此时的AOF文件),
    # 基准尺寸和当前尺寸做比较。如果当前尺寸超过指定比例,就会触发重写操作。
    #
    # 你还需要指定被重写日志的最小尺寸,这样避免了达到约定百分比但尺寸仍然很小的情况还要重写。
    #
    # 指定百分比为0会禁用AOF自动重写特性。

    auto-aof-rewrite-percentage 100
    auto-aof-rewrite-min-size 64mb

    ################################## 慢查询日志 ###################################

    # Redis慢查询日志可以记录超过指定时间的查询。运行时间不包括各种I/O时间。
    # 例如:连接客户端,发送响应数据等。只计算命令运行的实际时间(这是唯一一种命令运行线程阻塞而无法同时为其他请求服务的场景)
    #
    # 你可以为慢查询日志配置两个参数:一个是超标时间,单位为微妙,记录超过个时间的命令。
    # 另一个是慢查询日志长度。当一个新的命令被写进日志的时候,最老的那个记录会被删掉。
    #
    # 下面的时间单位是微秒,所以1000000就是1秒。注意,负数时间会禁用慢查询日志,而0则会强制记录所有命令。
    slowlog-log-slower-than 10000

    # 这个长度没有限制。只要有足够的内存就行。你可以通过 SLOWLOG RESET 来释放内存。(译者注:日志居然是在内存里的Orz)
    slowlog-max-len 128

    ################################ 虚拟内存 ###############################

    ### 警告!虚拟内存在Redis 2.4是反对的。
    ### 非常不鼓励使用虚拟内存!!

    # 虚拟内存可以使Redis在内存不够的情况下仍然可以将所有数据序列保存在内存里。
    # 为了做到这一点,高频key会调到内存里,而低频key会转到交换文件里,就像操作系统使用内存页一样。
    #
    # 要使用虚拟内存,只要把 "vm-enabled" 设置为 "yes",并根据需要设置下面三个虚拟内存参数就可以了。

    vm-enabled no
    # vm-enabled yes

    # 这是交换文件的路径。估计你猜到了,交换文件不能在多个Redis实例之间共享,所以确保每个Redis实例使用一个独立交换文件。
    #
    # 最好的保存交换文件(被随机访问)的介质是固态硬盘(SSD)。
    #
    # *** 警告 *** 如果你使用共享主机,那么默认的交换文件放到 /tmp 下是不安全的。
    # 创建一个Redis用户可写的目录,并配置Redis在这里创建交换文件。
    vm-swap-file /tmp/redis.swap

    # "vm-max-memory" 配置虚拟内存可用的最大内存容量。
    # 如果交换文件还有空间的话,所有超标部分都会放到交换文件里。
    #
    # "vm-max-memory" 设置为0表示系统会用掉所有可用内存。
    # 这默认值不咋地,只是把你能用的内存全用掉了,留点余量会更好。
    # 例如,设置为剩余内存的60%-80%。
    vm-max-memory 0

    # Redis交换文件是分成多个数据页的。
    # 一个可存储对象可以被保存在多个连续页里,但是一个数据页无法被多个对象共享。
    # 所以,如果你的数据页太大,那么小对象就会浪费掉很多空间。
    # 如果数据页太小,那用于存储的交换空间就会更少(假定你设置相同的数据页数量)
    #
    # 如果你使用很多小对象,建议分页尺寸为64或32个字节。
    # 如果你使用很多大对象,那就用大一些的尺寸。
    # 如果不确定,那就用默认值 :)
    vm-page-size 32

    # 交换文件里数据页总数。
    # 根据内存中分页表(已用/未用的数据页分布情况),磁盘上每8个数据页会消耗内存里1个字节。
    #
    # 交换区容量 = vm-page-size * vm-pages
    #
    # 根据默认的32字节的数据页尺寸和134217728的数据页数来算,Redis的数据页文件会占4GB,而内存里的分页表会消耗16MB内存。
    #
    # 为你的应验程序设置最小且够用的数字比较好,下面这个默认值在大多数情况下都是偏大的。
    vm-pages 134217728

    # 同时可运行的虚拟内存I/O线程数。
    # 这些线程可以完成从交换文件进行数据读写的操作,也可以处理数据在内存与磁盘间的交互和编码/解码处理。
    # 多一些线程可以一定程度上提高处理效率,虽然I/O操作本身依赖于物理设备的限制,不会因为更多的线程而提高单次读写操作的效率。
    #
    # 特殊值0会关闭线程级I/O,并会开启阻塞虚拟内存机制。
    vm-max-threads 4

    ############################### 高级配置 ###############################

    # 当有大量数据时,适合用哈希编码(需要更多的内存),元素数量上限不能超过给定限制。
    # 你可以通过下面的选项来设定这些限制:
    hash-max-zipmap-entries 512
    hash-max-zipmap-value 64

    # 与哈希相类似,数据元素较少的情况下,可以用另一种方式来编码从而节省大量空间。
    # 这种方式只有在符合下面限制的时候才可以用:
    list-max-ziplist-entries 512
    list-max-ziplist-value 64

    # 还有这样一种特殊编码的情况:数据全是64位无符号整型数字构成的字符串。
    # 下面这个配置项就是用来限制这种情况下使用这种编码的最大上限的。
    set-max-intset-entries 512

    # 与第一、第二种情况相似,有序序列也可以用一种特别的编码方式来处理,可节省大量空间。
    # 这种编码只适合长度和元素都符合下面限制的有序序列:
    zset-max-ziplist-entries 128
    zset-max-ziplist-value 64

    # 哈希刷新,每100个CPU毫秒会拿出1个毫秒来刷新Redis的主哈希表(顶级键值映射表)。
    # redis所用的哈希表实现(见dict.c)采用延迟哈希刷新机制:你对一个哈希表操作越多,哈希刷新操作就越频繁;
    # 反之,如果服务器非常不活跃那么也就是用点内存保存哈希表而已。
    #
    # 默认是每秒钟进行10次哈希表刷新,用来刷新字典,然后尽快释放内存。
    #
    # 建议:
    # 如果你对延迟比较在意的话就用 "activerehashing no",每个请求延迟2毫秒不太好嘛。
    # 如果你不太在意延迟而希望尽快释放内存的话就设置 "activerehashing yes"。
    activerehashing yes

    ################################## 包含 ###################################

    # 包含一个或多个其他配置文件。
    # 这在你有标准配置模板但是每个redis服务器又需要个性设置的时候很有用。
    # 包含文件特性允许你引人其他配置文件,所以好好利用吧。
    #
    # include /path/to/local.conf
    # include /path/to/other.conf

     

    展开全文
  • my.cnf中文版注释<一>

    2011-11-10 15:35:25
    注释得非常好.精 #BEGIN CONFIG INFO #DESCR: 4GB RAM, 只使用InnoDB, ACID, 少量的连接, 队列负载大 #TYPE: SYSTEM #END CONFIG INFO # # 此mysql配置文件例子针对4G内存 # 主要使用INNODB #处理复杂...

     从 hi!admin 抄来的一份配置.注释得非常好.精


    #BEGIN CONFIG INFO
    #DESCR: 4GB RAM, 只使用InnoDB, ACID, 少量的连接, 队列负载大
    #TYPE: SYSTEM
    #END CONFIG INFO

    #
    # 此mysql配置文件例子针对4G内存
    # 主要使用INNODB
    #处理复杂队列并且连接数量较少的mysql服务器

    # 将此文件复制到/etc/my.cnf 作为全局设置,
    # mysql-data-dir/my.cnf 作为服务器指定设置
    # (@localstatedir@ for this installation) 或者放入
    # ~/.my.cnf 作为用户设置.
    #
    # 在此配置文件中, 你可以使用所有程序支持的长选项.
    # 如果想获悉程序支持的所有选项
    # 请在程序后加上"--help"参数运行程序.
    #
    # 关于独立选项更多的细节信息可以在手册内找到
    #

    #
    # 以下选项会被MySQL客户端应用读取.
    # 注意只有MySQL附带的客户端应用程序保证可以读取这段内容.
    # 如果你想你自己的MySQL应用程序获取这些值
    # 需要在MySQL客户端库初始化的时候指定这些选项

    #
    [client]
    #password = [your_password]
    port = @MYSQL_TCP_PORT@
    socket = @MYSQL_UNIX_ADDR@

    # *** 应用定制选项 ***

    #
    #  MySQL 服务端
    #
    [mysqld]

    # 一般配置选项
    port = @MYSQL_TCP_PORT@
    socket = @MYSQL_UNIX_ADDR@

    # back_log 是操作系统在监听队列中所能保持的连接数,
    # 队列保存了在MySQL连接管理器线程处理之前的连接.
    # 如果你有非常高的连接率并且出现"connection refused" 报错,
    # 你就应该增加此处的值.
    # 检查你的操作系统文档来获取这个变量的最大值.
    # 如果将back_log设定到比你操作系统限制更高的值,将会没有效果
    back_log = 50

    # 不在TCP/IP端口上进行监听.
    # 如果所有的进程都是在同一台服务器连接到本地的mysqld,
    # 这样设置将是增强安全的方法
    # 所有mysqld的连接都是通过Unix sockets 或者命名管道进行的.
    # 注意在windows下如果没有打开命名管道选项而只是用此项
    # (通过 "enable-named-pipe" 选项) 将会导致mysql服务没有任何作用!
    #skip-networking

    # MySQL 服务所允许的同时会话数的上限
    # 其中一个连接将被SUPER权限保留作为管理员登录.
    # 即便已经达到了连接数的上限.
    max_connections = 100

    # 每个客户端连接最大的错误允许数量,如果达到了此限制.
    # 这个客户端将会被MySQL服务阻止直到执行了"FLUSH HOSTS" 或者服务重启
    # 非法的密码以及其他在链接时的错误会增加此值.
    # 查看 "Aborted_connects" 状态来获取全局计数器.
    max_connect_errors = 10

    # 所有线程所打开表的数量.
    # 增加此值就增加了mysqld所需要的文件描述符的数量
    # 这样你需要确认在[mysqld_safe]中 "open-files-limit" 变量设置打开文件数量允许至少4096
    table_cache = 2048

    # 允许外部文件级别的锁. 打开文件锁会对性能造成负面影响
    # 所以只有在你在同样的文件上运行多个数据库实例时才使用此选项(注意仍会有其他约束!) 
    # 或者你在文件层面上使用了其他一些软件依赖来锁定MyISAM表
    #external-locking

    # 服务所能处理的请求包的最大大小以及服务所能处理的最大的请求大小(当与大的BLOB字段一起工作时相当必要)
    # 每个连接独立的大小.大小动态增加
    max_allowed_packet = 16M

    # 在一个事务中binlog为了记录SQL状态所持有的cache大小
    # 如果你经常使用大的,多声明的事务,你可以增加此值来获取更大的性能. 
    # 所有从事务来的状态都将被缓冲在binlog缓冲中然后在提交后一次性写入到binlog中
    # 如果事务比此值大, 会使用磁盘上的临时文件来替代. 
    # 此缓冲在每个连接的事务第一次更新状态时被创建
    binlog_cache_size = 1M

    # 独立的内存表所允许的最大容量. 
    # 此选项为了防止意外创建一个超大的内存表导致永尽所有的内存资源.
    max_heap_table_size = 64M

    # 排序缓冲被用来处理类似ORDER BY以及GROUP BY队列所引起的排序
    # 如果排序后的数据无法放入排序缓冲, 
    # 一个用来替代的基于磁盘的合并分类会被使用
    # 查看 "Sort_merge_passes" 状态变量.
    # 在排序发生时由每个线程分配
    sort_buffer_size = 8M

    # 此缓冲被使用来优化全联合(full JOINs 不带索引的联合). 
    # 类似的联合在极大多数情况下有非常糟糕的性能表现,
    # 但是将此值设大能够减轻性能影响.
    # 通过 "Select_full_join" 状态变量查看全联合的数量
    # 当全联合发生时,在每个线程中分配
    join_buffer_size = 8M

    # 我们在cache中保留多少线程用于重用
    # 当一个客户端断开连接后,如果cache中的线程还少于thread_cache_size,
    # 则客户端线程被放入cache中. 
    # 这可以在你需要大量新连接的时候极大的减少线程创建的开销
    # (一般来说如果你有好的线程模型的话,这不会有明显的性能提升.)
    thread_cache_size = 8

    # 此允许应用程序给予线程系统一个提示在同一时间给予渴望被运行的线程的数量.
    # 此值只对于支持 thread_concurrency() 函数的系统有意义( 例如Sun Solaris).
    # 你可可以尝试使用 [CPU数量]*(2..4) 来作为thread_concurrency的值
    thread_concurrency = 8

    # 查询缓冲常被用来缓冲 SELECT 的结果并且在下一次同样查询的时候不再执行直接返回结果. 
    # 打开查询缓冲可以极大的提高服务器速度, 如果你有大量的相同的查询并且很少修改表.
    # 查看 "Qcache_lowmem_prunes" 状态变量来检查是否当前值对于你的负载来说是否足够高.
    # 注意: 在你表经常变化的情况下或者如果你的查询原文每次都不同,
    # 查询缓冲也许引起性能下降而不是性能提升.
    query_cache_size = 64M

    # 只有小于此设定值的结果才会被缓冲
    # 此设置用来保护查询缓冲,防止一个极大的结果集将其他所有的查询结果都覆盖.
    query_cache_limit = 2M

    # 被全文检索索引的最小的字长.
    # 你也许希望减少它,如果你需要搜索更短字的时候.
    # 注意在你修改此值之后,
    # 你需要重建你的 FULLTEXT 索引
    ft_min_word_len = 4

    # 如果你的系统支持 memlock() 函数,你也许希望打开此选项用以让运行中的mysql在在内存高度紧张的时候,数据在内存中保持锁定并且防止可能被swapping out
    # 此选项对于性能有益
    #memlock

    # 当创建新表时作为默认使用的表类型,
    # 如果在创建表示没有特别执行表类型,将会使用此值
    default_table_type = MYISAM

    # 线程使用的堆大小. 此容量的内存在每次连接时被预留.
    # MySQL 本身常不会需要超过64K的内存
    # 如果你使用你自己的需要大量堆的UDF函数
    # 或者你的操作系统对于某些操作需要更多的堆,
    # 你也许需要将其设置的更高一点.
    thread_stack = 192K

    # 设定默认的事务隔离级别.可用的级别如下:
    # READ-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ, SERIALIZABLE
    transaction_isolation = REPEATABLE-READ

    # 内部(内存中)临时表的最大大小
    # 如果一个表增长到比此值更大,将会自动转换为基于磁盘的表.
    # 此限制是针对单个表的,而不是总和. 
    tmp_table_size = 64M

    # 打开二进制日志功能.
    # 在复制(replication)配置中,作为MASTER主服务器必须打开此项
    # 如果你需要从你最后的备份中做基于时间点的恢复,你也同样需要二进制日志.
    log-bin=mysql-bin

    # 如果你在使用链式从服务器结构的复制模式 (A->B->C), 
    # 你需要在服务器B上打开此项. 
    # 此选项打开在从线程上重做过的更新的日志,
    # 并将其写入从服务器的二进制日志.
    #log_slave_updates

    # 打开全查询日志. 所有的由服务器接收到的查询 (甚至对于一个错误语法的查询) 
    # 都会被记录下来. 这对于调试非常有用, 在生产环境中常常关闭此项.
    #log

    # 将警告打印输出到错误log文件.  如果你对于MySQL有任何问题
    # 你应该打开警告log并且仔细审查错误日志,查出可能的原因. 
    #log_warnings

    # 记录慢速查询. 慢速查询是指消耗了比 "long_query_time" 定义的更多时间的查询.
    # 如果 log_long_format 被打开,那些没有使用索引的查询也会被记录.
    # 如果你经常增加新查询到已有的系统内的话. 一般来说这是一个好主意,
    log_slow_queries

    # 所有的使用了比这个时间(以秒为单位)更多的查询会被认为是慢速查询.
    # 不要在这里使用"1", 否则会导致所有的查询,甚至非常快的查询页被记录下来(由于MySQL 目前时间的精确度只能达到秒的级别).
    long_query_time = 2

    # 在慢速日志中记录更多的信息.
    # 一般此项最好打开.
    # 打开此项会记录使得那些没有使用索引的查询也被作为到慢速查询附加到慢速日志里
    log_long_format

    # 此目录被MySQL用来保存临时文件.例如,
    # 它被用来处理基于磁盘的大型排序,和内部排序一样.
    # 以及简单的临时表.
    # 如果你不创建非常大的临时文件,将其放置到 swapfs/tmpfs 文件系统上也许比较好
    # 另一种选择是你也可以将其放置在独立的磁盘上. 
    # 你可以使用";"来放置多个路径
    # 他们会按照roud-robin方法被轮询使用.
    #tmpdir = /tmp


    # ***  复制有关的设置


    # 唯一的服务辨识号,数值位于 1 到 2^32-1之间. 
    # 此值在master和slave上都需要设置.
    # 如果 "master-host" 没有被设置,则默认为1, 但是如果忽略此选项,MySQL不会作为master生效.
    server-id = 1

    # 复制的Slave (去掉master段的注释来使其生效)
    #
    # 为了配置此主机作为复制的slave服务器,你可以选择两种方法:
    #
    # 1) 使用 CHANGE MASTER TO 命令 (在我们的手册中有完整描述) -
    #    语法如下:
    #
    #    CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
    #    MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
    #
    #    你需要替换掉 <host>, <user>, <password> 等被尖括号包围的字段以及使用master的端口号替换<port> (默认3306).
    #
    #    例子:
    #
    #    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
    #    MASTER_USER='joe', MASTER_PASSWORD='secret';
    #
    # 或者
    #
    # 2) 设置以下的变量. 不论如何, 在你选择这种方法的情况下, 然后第一次启动复制(甚至不成功的情况下,
    #     例如如果你输入错密码在master-password字段并且slave无法连接), 
    #    slave会创建一个 master.info 文件,并且之后任何对于包含在此文件内的参数的变化都会被忽略
    #    并且由 master.info 文件内的内容覆盖, 除非你关闭slave服务, 删除 master.info 并且重启slave 服务.
    #    由于这个原因,你也许不想碰一下的配置(注释掉的) 并且使用 CHANGE MASTER TO (查看上面) 来代替
    #
    # 所需要的唯一id号位于 2 和 2^32 - 1之间
    # (并且和master不同)
    # 如果master-host被设置了.则默认值是2
    # 但是如果省略,则不会生效
    #server-id = 2
    #
    # 复制结构中的master - 必须
    #master-host = <hostname>
    #
    # 当连接到master上时slave所用来认证的用户名 - 必须
    #master-user = <username>
    #
    # 当连接到master上时slave所用来认证的密码 - 必须
    #master-password = <password>
    #
    # master监听的端口.
    # 可选 - 默认是3306
    #master-port = <port>

    # 使得slave只读.只有用户拥有SUPER权限和在上面的slave线程能够修改数据.
    # 你可以使用此项去保证没有应用程序会意外的修改slave而不是master上的数据
    #read_only



    转载于:https://blog.51cto.com/imysqldba/711068

    展开全文
  • my.cnf中文版注释<二>

    2011-11-10 15:37:17
    因为长度限制,所以分为两篇 #*** MyISAM 相关选项 # 关键词缓冲的大小, 一般用来缓冲MyISAM表的索引块. # 不要将其设置大于你可用内存的30%, ...# 因为一部分内存同样被OS用来缓冲行数据 ...# 甚至在你并不使用...

    因为长度限制,所以分为两篇

     #*** MyISAM 相关选项


    # 关键词缓冲的大小, 一般用来缓冲MyISAM表的索引块.
    # 不要将其设置大于你可用内存的30%, 
    # 因为一部分内存同样被OS用来缓冲行数据 
    # 甚至在你并不使用MyISAM 表的情况下, 你也需要仍旧设置起 8-64M 内存由于它同样会被内部临时磁盘表使用.
    key_buffer_size = 32M

    # 用来做MyISAM表全表扫描的缓冲大小.
    # 当全表扫描需要时,在对应线程中分配.
    read_buffer_size = 2M

    # 当在排序之后,从一个已经排序好的序列中读取行时,行数据将从这个缓冲中读取来防止磁盘寻道. 
    # 如果你增高此值,可以提高很多ORDER BY的性能.
    # 当需要时由每个线程分配
    read_rnd_buffer_size = 16M

    # MyISAM 使用特殊的类似树的cache来使得突发插入
    # (这些插入是,INSERT ... SELECT, INSERT ... VALUES (...), (...), ..., 以及 LOAD DATA
    # INFILE) 更快. 此变量限制每个进程中缓冲树的字节数. 
    # 设置为 0 会关闭此优化.
    # 为了最优化不要将此值设置大于 "key_buffer_size".
    # 当突发插入被检测到时此缓冲将被分配.
    bulk_insert_buffer_size = 64M

    # 此缓冲当MySQL需要在 REPAIR, OPTIMIZE, ALTER 以及 LOAD DATA INFILE 到一个空表中引起重建索引时被分配.
    # 这在每个线程中被分配.所以在设置大值时需要小心.
    myisam_sort_buffer_size = 128M

    # MySQL重建索引时所允许的最大临时文件的大小 (当 REPAIR, ALTER TABLE 或者 LOAD DATA INFILE).
    # 如果文件大小比此值更大,索引会通过键值缓冲创建(更慢)
    myisam_max_sort_file_size = 10G

    # 如果被用来更快的索引创建索引所使用临时文件大于制定的值,那就使用键值缓冲方法.
    # 这主要用来强制在大表中长字串键去使用慢速的键值缓冲方法来创建索引.
    myisam_max_extra_sort_file_size = 10G

    # 如果一个表拥有超过一个索引, MyISAM 可以通过并行排序使用超过一个线程去修复他们.
    # 这对于拥有多个CPU以及大量内存情况的用户,是一个很好的选择.
    myisam_repair_threads = 1

    # 自动检查和修复没有适当关闭的 MyISAM 表.
    myisam_recover


    # 默认关闭 Federated 
    skip-federated

    # *** BDB 相关选项 ***

    # 如果你运行的MySQL服务有BDB支持但是你不准备使用的时候使用此选项. 这会节省内存并且可能加速一些事.
    skip-bdb


    # *** INNODB 相关选项 ***

    # 如果你的MySQL服务包含InnoDB支持但是并不打算使用的话,
    # 使用此选项会节省内存以及磁盘空间,并且加速某些部分
    #skip-innodb

    # 附加的内存池被InnoDB用来保存 metadata 信息
    # 如果InnoDB为此目的需要更多的内存,它会开始从OS这里申请内存.
    # 由于这个操作在大多数现代操作系统上已经足够快, 你一般不需要修改此值.
    # SHOW INNODB STATUS 命令会显示当先使用的数量.
    innodb_additional_mem_pool_size = 16M

    # InnoDB使用一个缓冲池来保存索引和原始数据, 不像 MyISAM. 
    # 这里你设置越大,你在存取表里面数据时所需要的磁盘I/O越少.
    # 在一个独立使用的数据库服务器上,你可以设置这个变量到服务器物理内存大小的80%
    # 不要设置过大,否则,由于物理内存的竞争可能导致操作系统的换页颠簸. 
    # 注意在32位系统上你每个进程可能被限制在 2-3.5G 用户层面内存限制,
    # 所以不要设置的太高.
    innodb_buffer_pool_size = 2G

    # InnoDB 将数据保存在一个或者多个数据文件中成为表空间.
    # 如果你只有单个逻辑驱动保存你的数据,一个单个的自增文件就足够好了.
    # 其他情况下.每个设备一个文件一般都是个好的选择.
    # 你也可以配置InnoDB来使用裸盘分区 - 请参考手册来获取更多相关内容
    innodb_data_file_path = ibdata1:10M:autoextend

    # 设置此选项如果你希望InnoDB表空间文件被保存在其他分区.
    # 默认保存在MySQL的datadir中.
    #innodb_data_home_dir = <directory>

    # 用来同步IO操作的IO线程的数量. This value is
    # 此值在Unix下被硬编码为4,但是在Windows磁盘I/O可能在一个大数值下表现的更好.
    innodb_file_io_threads = 4

    # 如果你发现InnoDB表空间损坏, 设置此值为一个非零值可能帮助你导出你的表.
    # 从1开始并且增加此值知道你能够成功的导出表.
    #innodb_force_recovery=1

    # 在InnoDb核心内的允许线程数量. 
    # 最优值依赖于应用程序,硬件以及操作系统的调度方式. 
    # 过高的值可能导致线程的互斥颠簸.
    innodb_thread_concurrency = 16

    # 如果设置为1 ,InnoDB会在每次提交后刷新(fsync)事务日志到磁盘上,
    # 这提供了完整的ACID行为.
    # 如果你愿意对事务安全折衷, 并且你正在运行一个小的食物, 你可以设置此值到0或者2来减少由事务日志引起的磁盘I/O
    # 0代表日志只大约每秒写入日志文件并且日志文件刷新到磁盘. 
    # 2代表日志写入日志文件在每次提交后,但是日志文件只有大约每秒才会刷新到磁盘上.
    innodb_flush_log_at_trx_commit = 1

    # 加速InnoDB的关闭. 这会阻止InnoDB在关闭时做全清除以及插入缓冲合并.
    # 这可能极大增加关机时间, 但是取而代之的是InnoDB可能在下次启动时做这些操作.
    #innodb_fast_shutdown

    # 用来缓冲日志数据的缓冲区的大小.
    # 当此值快满时, InnoDB将必须刷新数据到磁盘上.
    # 由于基本上每秒都会刷新一次,所以没有必要将此值设置的太大(甚至对于长事务而言)

    innodb_log_buffer_size = 8M

    # 在日志组中每个日志文件的大小.
    # 你应该设置日志文件总合大小到你缓冲池大小的25%~100%
    # 来避免在日志文件覆写上不必要的缓冲池刷新行为.
    # 不论如何, 请注意一个大的日志文件大小会增加恢复进程所需要的时间.
    innodb_log_file_size = 256M

    # 在日志组中的文件总数.
    # 通常来说2~3是比较好的.
    innodb_log_files_in_group = 3

    # InnoDB的日志文件所在位置. 默认是MySQL的datadir.
    # 你可以将其指定到一个独立的硬盘上或者一个RAID1卷上来提高其性能
    #innodb_log_group_home_dir

    # 在InnoDB缓冲池中最大允许的脏页面的比例.
    # 如果达到限额, InnoDB会开始刷新他们防止他们妨碍到干净数据页面.
    # 这是一个软限制,不被保证绝对执行.
    innodb_max_dirty_pages_pct = 90

    # InnoDB用来刷新日志的方法.
    # 表空间总是使用双重写入刷新方法
    # 默认值是 "fdatasync", 另一个是 "O_DSYNC".
    #innodb_flush_method=O_DSYNC

    # 在被回滚前,一个InnoDB的事务应该等待一个锁被批准多久.
    # InnoDB在其拥有的锁表中自动检测事务死锁并且回滚事务.
    # 如果你使用 LOCK TABLES 指令, 或者在同样事务中使用除了InnoDB以外的其他事务安全的存储引擎
    # 那么一个死锁可能发生而InnoDB无法注意到.
    # 这种情况下这个timeout值对于解决这种问题就非常有帮助.
    innodb_lock_wait_timeout = 120


    [mysqldump]
    # 不要在将内存中的整个结果写入磁盘之前缓存. 在导出非常巨大的表时需要此项
    quick

    max_allowed_packet = 16M

    [mysql]
    no-auto-rehash

    # 仅仅允许使用键值的 UPDATEs 和 DELETEs .
    #safe-updates

    [isamchk]
    key_buffer = 512M
    sort_buffer_size = 512M
    read_buffer = 8M
    write_buffer = 8M

    [myisamchk]
    key_buffer = 512M
    sort_buffer_size = 512M
    read_buffer = 8M
    write_buffer = 8M

    [mysqlhotcopy]
    interactive-timeout

    [mysqld_safe]
    # 增加每个进程的可打开文件数量.
    # 警告: 确认你已经将全系统限制设定的足够高! 
    # 打开大量表需要将此值设高
    open-files-limit = 8192

    转载于:https://blog.51cto.com/imysqldba/711070

    展开全文
  • sqlHelper 中文注释版

    2018-11-13 09:22:13
    sqlHelper 中文注释版,sqlHelper 中文注释版,sqlHelper 中文注释版
  • Socket中文注释版本

    2019-02-21 09:30:19
    Socket中文注释版本
  • MSCKF 中文注释版

    2021-01-01 16:02:17
    MSCKF 中文注释版,多状态约束下的Kalman滤波器,Multi-State Constraint Kalman Filter
  • 代码大全-中文版-注释,代码大全-中文版-注释,代码大全-中文版-注释
  • OpenAL文档中文注释版

    2017-03-01 09:25:16
    OpenAL文档中文注释版
  • Spring源码中文注释版

    2021-05-01 10:48:28
    spring-framework-5.0.2.RELEASE.rar Spring源码中文注释版
  • redis中文注释版.conf

    2020-06-08 12:10:47
    redis的中文注释版,对redis中的内容添加了详细的中文注解,方便理解和修改配置!!! redis的中文注释版,对redis中的内容添加了详细的中文注解,方便理解和修改配置!!! redis的中文注释版,对redis中的内容添加...
  • redis中文注释版

    2020-11-09 19:12:46
    redis中文注释版 # Redis configuration file example. # # Note that in order to read the configuration file, Redis must be # started with the file path as first argument: # # ./redis-server /path/to/...

    redis中文注释版

    # Redis configuration file example.
    #
    # Note that in order to read the configuration file, Redis must be
    # started with the file path as first argument:
    #
    # ./redis-server /path/to/redis.conf
    
    # Note on units: when memory size is needed, it is possible to specify
    # it in the usual form of 1k 5GB 4M and so forth:
    # 配置大小单位,开头定义了一些基本的度量单位,只支持bytes,不支持bit 对大小写不敏感
    # 1k => 1000 bytes
    # 1kb => 1024 bytes
    # 1m => 1000000 bytes
    # 1mb => 1024*1024 bytes
    # 1g => 1000000000 bytes
    # 1gb => 1024*1024*1024 bytes
    #
    # units are case insensitive so 1GB 1Gb 1gB are all the same.
    
    ################################## INCLUDES ###################################
    
    # Include one or more other config files here. This is useful if you
    # have a standard template that goes to all Redis servers but also need
    # to customize a few per-server settings. Include files can include
    # other files, so use this wisely.
    #
    # Notice option "include" won't be rewritten by command "CONFIG REWRITE"
    # from admin or Redis Sentinel. Since Redis always uses the last processed
    # line as value of a configuration directive, you'd better put includes
    # at the beginning of this file to avoid overwriting config change at runtime.
    #
    # If instead you are interested in using includes to override configuration
    # options, it is better to use include as the last line.
    # 引入其他文件
    # include /path/to/local.conf
    # include /path/to/other.conf
    
    ################################## MODULES #####################################
    
    # Load modules at startup. If the server is not able to load modules
    # it will abort. It is possible to use multiple loadmodule directives.
    #
    # loadmodule /path/to/my_module.so
    # loadmodule /path/to/other_module.so
    
    ################################## NETWORK #####################################
    
    # By default, if no "bind" configuration directive is specified, Redis listens
    # for connections from all the network interfaces available on the server.
    # It is possible to listen to just one or multiple selected interfaces using
    # the "bind" configuration directive, followed by one or more IP addresses.
    #
    # Examples:
    #
    # bind 192.168.1.100 10.0.0.1
    # bind 127.0.0.1 ::1
    #
    # ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the
    # internet, binding to all the interfaces is dangerous and will expose the
    # instance to everybody on the internet. So by default we uncomment the
    # following bind directive, that will force Redis to listen only into
    # the IPv4 loopback interface address (this means Redis will be able to
    # accept connections only from clients running into the same computer it
    # is running).
    #
    # IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES
    # JUST COMMENT THE FOLLOWING LINE.
    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # 绑定Ip 指定可以连接本实例Redis的ip 如果注释(删掉)则任意IP都可以连接
    bind 127.0.0.1
    
    # Protected mode is a layer of security protection, in order to avoid that
    # Redis instances left open on the internet are accessed and exploited.
    #
    # When protected mode is on and if:
    #
    # 1) The server is not binding explicitly to a set of addresses using the
    # "bind" directive.
    # 2) No password is configured.
    #
    # The server only accepts connections from clients connecting from the
    # IPv4 and IPv6 loopback addresses 127.0.0.1 and ::1, and from Unix domain
    # sockets.
    #
    # By default protected mode is enabled. You should disable it only if
    # you are sure you want clients from other hosts to connect to Redis
    # even if no authentication is configured, nor a specific set of interfaces
    # are explicitly listed using the "bind" directive.
    #禁止外网访问redis,如果启用了,即使注释掉了bind 127.0.0.1,再访问redisd时候还是无法连接的
    #它启用的条件有两个,第一是没有使用bind,第二是没有设置访问密码。
    protected-mode yes
    
    # Accept connections on the specified port, default is 6379 (IANA #815344).
    # If port 0 is specified Redis will not listen on a TCP socket.
    #指定Redis的端口
    port 6379
    
    # TCP listen() backlog.
    #
    # In high requests-per-second environments you need an high backlog in order
    # to avoid slow clients connections issues. Note that the Linux kernel
    # will silently truncate it to the value of /proc/sys/net/core/somaxconn so
    # make sure to raise both the value of somaxconn and tcp_max_syn_backlog
    # in order to get the desired effect.
    # 此参数确定了TCP连接中已完成队列(完成三次握手之后)的长度, 
    # 当然此值必须不大于Linux系统定义的/proc/sys/net/core/somaxconn值,默认是511,
    # 而Linux的默认参数值是128。当系统并发量大并且客户端速度缓慢的时候,可以将这二个参数一起参考设定。
    # 在高并发环境下你需要一个高backlog值来避免慢客户端连接问题
    tcp-backlog 511
    
    # Unix socket.
    #
    # Specify the path for the Unix socket that will be used to listen for
    # incoming connections. There is no default, so Redis will not listen
    # on a unix socket when not specified.
    #
    # unixsocket /tmp/redis.sock
    # unixsocketperm 700
    
    # Close the connection after a client is idle for N seconds (0 to disable)
    # 当客户端闲置多长时间后关闭连接,如果指定为0,表示关闭该功能
    timeout 0
    
    # TCP keepalive.
    #
    # If non-zero, use SO_KEEPALIVE to send TCP ACKs to clients in absence
    # of communication. This is useful for two reasons:
    #
    # 1) Detect dead peers.
    # 2) Take the connection alive from the point of view of network
    # equipment in the middle.
    #
    # On Linux, the specified value (in seconds) is the period used to send ACKs.
    # Note that to close the connection the double of the time is needed.
    # On other kernels the period depends on the kernel configuration.
    #
    # A reasonable value for this option is 300 seconds, which is the new
    # Redis default starting with Redis 3.2.1.
    # 设置多长时间检测死连接 单位为秒,如果设置为0,则不会进行Keepalive检测
    tcp-keepalive 300
    
    ################################# GENERAL #####################################
    
    # By default Redis does not run as a daemon. Use 'yes' if you need it.
    # Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
    # 是否以守护进程启动
    daemonize no
    
    # If you run Redis from upstart or systemd, Redis can interact with your
    # supervision tree. Options:
    # supervised no - no supervision interaction
    # supervised upstart - signal upstart by putting Redis into SIGSTOP mode
    # supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET
    # supervised auto - detect upstart or systemd method based on
    # UPSTART_JOB or NOTIFY_SOCKET environment variables
    # Note: these supervision methods only signal "process is ready."
    # They do not enable continuous liveness pings back to your supervisor.
    #可以通过upstart和systemd管理Redis守护进程,这个参数是和具体的操作系统相关的。
    supervised no
    
    # If a pid file is specified, Redis writes it where specified at startup
    # and removes it at exit.
    #
    # When the server runs non daemonized, no pid file is created if none is
    # specified in the configuration. When the server is daemonized, the pid file
    # is used even if not specified, defaulting to "/var/run/redis.pid".
    #
    # Creating a pid file is best effort: if Redis is not able to create it
    # nothing bad happens, the server will start and run normally.
    #当Redis以守护进程方式运行时,Redis默认会把pid写入/var/run/redis.pid文件,可以通过pidfile指定
    pidfile /var/run/redis_6379.pid
    
    # Specify the server verbosity level.
    # This can be one of:
    # debug (a lot of information, useful for development/testing)
    # verbose (many rarely useful info, but not a mess like the debug level)
    # notice (moderately verbose, what you want in production probably)
    # warning (only very important / critical messages are logged)
    #设置日志的级别 debug、verbose、notice、warning,默认为verbose
    loglevel notice
    
    # Specify the log file name. Also the empty string can be used to force
    # Redis to log on the standard output. Note that if you use standard
    # output for logging but daemonize, logs will be sent to /dev/null
    #日志文件的位置,当指定为空字符串时,为标准输出,如果redis已守护进程模式运行,那么日志将会输出到 /dev/null 。
    logfile ""
    
    # To enable logging to the system logger, just set 'syslog-enabled' to yes,
    # and optionally update the other syslog parameters to suit your needs.
    # syslog-enabled no
    
    # Specify the syslog identity.
    # syslog-ident redis
    
    # Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7.
    # syslog-facility local0
    
    # Set the number of databases. The default database is DB 0, you can select
    # a different one on a per-connection basis using SELECT <dbid> where
    # dbid is a number between 0 and 'databases'-1
    # 设置数据库的数目。默认的数据库是DB 0 ,可以在每个连接上使用select <dbid> 命令选择一个不同的数据库,dbid是一个介于0到databases - 1 之间的数值。
    databases 16
    
    # By default Redis shows an ASCII art logo only when started to log to the
    # standard output and if the standard output is a TTY. Basically this means
    # that normally a logo is displayed only in interactive sessions.
    #
    # However it is possible to force the pre-4.0 behavior and always show a
    # ASCII art logo in startup logs by setting the following option to yes.
    always-show-logo yes
    
    ################################ SNAPSHOTTING ################################
    #
    # Save the DB on disk:
    #
    # save <seconds> <changes>
    #
    # Will save the DB if both the given number of seconds and the given
    # number of write operations against the DB occurred.
    #
    # In the example below the behaviour will be to save:
    # after 900 sec (15 min) if at least 1 key changed
    # after 300 sec (5 min) if at least 10 keys changed
    # after 60 sec if at least 10000 keys changed
    #
    # Note: you can disable saving completely by commenting out all "save" lines.
    #
    # It is also possible to remove all the previously configured save
    # points by adding a save directive with a single empty string argument
    # like in the following example:
    #
    # save ""
    # 指定在多长时间内,有多少次更新操作,就将数据同步到数据文件,可以多个条件配合
    # 这里表示900秒(15分钟)内有1个更改,300秒(5分钟)内有10个更改以及60秒内有10000个更改
    # 如果想禁用RDB持久化的策略,只要不设置任何save指令,或者给save传入一个空字符串参数也可以
    save 900 1
    save 300 10
    save 60 10000
    
    # By default Redis will stop accepting writes if RDB snapshots are enabled
    # (at least one save point) and the latest background save failed.
    # This will make the user aware (in a hard way) that data is not persisting
    # on disk properly, otherwise chances are that no one will notice and some
    # disaster will happen.
    #
    # If the background saving process will start working again Redis will
    # automatically allow writes again.
    #
    # However if you have setup your proper monitoring of the Redis server
    # and persistence, you may want to disable this feature so that Redis will
    # continue to work as usual even if there are problems with disk,
    # permissions, and so forth.
    # 默认情况下,如果 redis 最后一次的后台保存失败,redis 将停止接受写操作,这样以一种强硬的方式让用户知道数据不能正确的持久化到磁盘, 
    # 否则就会没人注意到灾难的发生。 如果后台保存进程重新启动工作了,redis 也将自动的允许写操作。
    # 如果配置成no,表示你不在乎数据不一致或者有其他的手段发现和控制
    stop-writes-on-bgsave-error yes
    
    # Compress string objects using LZF when dump .rdb databases?
    # For default that's set to 'yes' as it's almost always a win.
    # If you want to save some CPU in the saving child set it to 'no' but
    # the dataset will likely be bigger if you have compressible values or keys.
    # 对于存储到磁盘中的快照(rdb),可以设置是否进行压缩存储。如果是的话,redis会采用
    # LZF算法进行压缩。如果你不想消耗CPU来进行压缩的话,可以设置为关闭此功能
    rdbcompression yes
    
    # Since version 5 of RDB a CRC64 checksum is placed at the end of the file.
    # This makes the format more resistant to corruption but there is a performance
    # hit to pay (around 10%) when saving and loading RDB files, so you can disable it
    # for maximum performances.
    #
    # RDB files created with checksum disabled have a checksum of zero that will
    # tell the loading code to skip the check.
    # 在存储快照后,还可以让redis使用CRC64算法来进行数据校验,但是这样做会增加大约
    # 10%的性能消耗,如果希望获取到最大的性能提升,可以关闭此功能
    rdbchecksum yes
    
    # The filename where to dump the DB
    #rdb文件的名字。
    dbfilename dump.rdb
    
    # The working directory.
    #
    # The DB will be written inside this directory, with the filename specified
    # above using the 'dbfilename' configuration directive.
    #
    # The Append Only File will also be created inside this directory.
    #
    # Note that you must specify a directory here, not a file name.
    # dbfilename文件存放目录。必须是一个目录,aof文件也会保存到该目录下。
    dir ./
    
    ################################# REPLICATION #################################
    
    # Master-Replica replication. Use replicaof to make a Redis instance a copy of
    # another Redis server. A few things to understand ASAP about Redis replication.
    #
    # +------------------+ +---------------+
    # | Master | ---> | Replica |
    # | (receive writes) | | (exact copy) |
    # +------------------+ +---------------+
    #
    # 1) Redis replication is asynchronous, but you can configure a master to
    # stop accepting writes if it appears to be not connected with at least
    # a given number of replicas.
    # 2) Redis replicas are able to perform a partial resynchronization with the
    # master if the replication link is lost for a relatively small amount of
    # time. You may want to configure the replication backlog size (see the next
    # sections of this file) with a sensible value depending on your needs.
    # 3) Replication is automatic and does not need user intervention. After a
    # network partition replicas automatically try to reconnect to masters
    # and resynchronize with them.
    #设置当本机为slave服务时,设置master服务的IP地址及端口,在Redis启动时,它会自动从master进行数据同步
    # replicaof <masterip> <masterport>
    
    # If the master is password protected (using the "requirepass" configuration
    # directive below) it is possible to tell the replica to authenticate before
    # starting the replication synchronization process, otherwise the master will
    # refuse the replica request.
    #当master服务设置了密码保护时,slave服务连接master的密码
    # masterauth <master-password>
    
    # When a replica loses its connection with the master, or when the replication
    # is still in progress, the replica can act in two different ways:
    #
    # 1) if replica-serve-stale-data is set to 'yes' (the default) the replica will
    # still reply to client requests, possibly with out of date data, or the
    # data set may just be empty if this is the first synchronization.
    #
    # 2) if replica-serve-stale-data is set to 'no' the replica will reply with
    # an error "SYNC with master in progress" to all the kind of commands
    # but to INFO, replicaOF, AUTH, PING, SHUTDOWN, REPLCONF, ROLE, CONFIG,
    # SUBSCRIBE, UNSUBSCRIBE, PSUBSCRIBE, PUNSUBSCRIBE, PUBLISH, PUBSUB,
    # COMMAND, POST, HOST: and LATENCY.
    #当一个slave与master失去联系时,或者复制正在进行的时候,slave应对请求的行为: 
    #如果为 yes(默认值) ,slave 仍然会应答客户端请求,但返回的数据可能是过时,或者数据可能是空的在第一次同步的时候
    #如果为 no ,在你执行除了 info 和 salveof 之外的其他命令时,slave 都将返回一个 "SYNC with master in progress" 的错误。
    replica-serve-stale-data yes
    
    # You can configure a replica instance to accept writes or not. Writing against
    # a replica instance may be useful to store some ephemeral data (because data
    # written on a replica will be easily deleted after resync with the master) but
    # may also cause problems if clients are writing to it because of a
    # misconfiguration.
    #
    # Since Redis 2.6 by default replicas are read-only.
    #
    # Note: read only replicas are not designed to be exposed to untrusted clients
    # on the internet. It's just a protection layer against misuse of the instance.
    # Still a read only replica exports by default all the administrative commands
    # such as CONFIG, DEBUG, and so forth. To a limited extent you can improve
    # security of read only replicas using 'rename-command' to shadow all the
    # administrative / dangerous commands.
    #设置slave是否是只读的。从2.6版起,slave默认是只读的。
    replica-read-only yes
    
    # Replication SYNC strategy: disk or socket.
    #
    # -------------------------------------------------------
    # WARNING: DISKLESS REPLICATION IS EXPERIMENTAL CURRENTLY
    # -------------------------------------------------------
    #
    # New replicas and reconnecting replicas that are not able to continue the replication
    # process just receiving differences, need to do what is called a "full
    # synchronization". An RDB file is transmitted from the master to the replicas.
    # The transmission can happen in two different ways:
    #
    # 1) Disk-backed: The Redis master creates a new process that writes the RDB
    # file on disk. Later the file is transferred by the parent
    # process to the replicas incrementally.
    # 2) Diskless: The Redis master creates a new process that directly writes the
    # RDB file to replica sockets, without touching the disk at all.
    #
    # With disk-backed replication, while the RDB file is generated, more replicas
    # can be queued and served with the RDB file as soon as the current child producing
    # the RDB file finishes its work. With diskless replication instead once
    # the transfer starts, new replicas arriving will be queued and a new transfer
    # will start when the current one terminates.
    #
    # When diskless replication is used, the master waits a configurable amount of
    # time (in seconds) before starting the transfer in the hope that multiple replicas
    # will arrive and the transfer can be parallelized.
    #
    # With slow disks and fast (large bandwidth) networks, diskless replication
    # works better.
    # 主从数据复制是否使用无硬盘复制功能。
    repl-diskless-sync no
    
    # When diskless replication is enabled, it is possible to configure the delay
    # the server waits in order to spawn the child that transfers the RDB via socket
    # to the replicas.
    #
    # This is important since once the transfer starts, it is not possible to serve
    # new replicas arriving, that will be queued for the next RDB transfer, so the server
    # waits a delay in order to let more replicas arrive.
    #
    # The delay is specified in seconds, and by default is 5 seconds. To disable
    # it entirely just set it to 0 seconds and the transfer will start ASAP.
    repl-diskless-sync-delay 5
    
    # Replicas send PINGs to server in a predefined interval. It's possible to change
    # this interval with the repl_ping_replica_period option. The default value is 10
    # seconds.
    # 指定slave定期ping master的周期,默认10秒钟。
    # repl-ping-replica-period 10
    
    # The following option sets the replication timeout for:
    #
    # 1) Bulk transfer I/O during SYNC, from the point of view of replica.
    # 2) Master timeout from the point of view of replicas (data, pings).
    # 3) Replica timeout from the point of view of masters (REPLCONF ACK pings).
    #
    # It is important to make sure that this value is greater than the value
    # specified for repl-ping-replica-period otherwise a timeout will be detected
    # every time there is low traffic between the master and the replica.
    #设置主库批量数据传输时间或者ping回复时间间隔,默认值是60秒 。
    # repl-timeout 60
    
    # Disable TCP_NODELAY on the replica socket after SYNC?
    #
    # If you select "yes" Redis will use a smaller number of TCP packets and
    # less bandwidth to send data to replicas. But this can add a delay for
    # the data to appear on the replica side, up to 40 milliseconds with
    # Linux kernels using a default configuration.
    #
    # If you select "no" the delay for data to appear on the replica side will
    # be reduced but more bandwidth will be used for replication.
    #
    # By default we optimize for low latency, but in very high traffic conditions
    # or when the master and replicas are many hops away, turning this to "yes" may
    # be a good idea.
    #指定向slave同步数据时,是否禁用socket的NO_DELAY选项。
    #若配置为“yes”,则禁用NO_DELAY,则TCP协议栈会合并小包统一发送,这样可以减少主从节点间的包数量并节省带宽,但会增加数据同步到 slave的时间。
    #若配置为“no”,表明启用NO_DELAY,则TCP协议栈不会延迟小包的发送时机,这样数据同步的延时会减少,但需要更大的带宽。 
    #通常情况下,应该配置为no以降低同步延时,但在主从节点间网络负载已经很高的情况下,可以配置为yes。
    repl-disable-tcp-nodelay no
    
    # Set the replication backlog size. The backlog is a buffer that accumulates
    # replica data when replicas are disconnected for some time, so that when a replica
    # wants to reconnect again, often a full resync is not needed, but a partial
    # resync is enough, just passing the portion of data the replica missed while
    # disconnected.
    #
    # The bigger the replication backlog, the longer the time the replica can be
    # disconnected and later be able to perform a partial resynchronization.
    #
    # The backlog is only allocated once there is at least a replica connected.
    # 设置主从复制backlog容量大小。这个 backlog 是一个用来在 slaves 被断开连接时存放 slave 数据的 buffer,
    # 所以当一个 slave 想要重新连接,通常不希望全部重新同步,只是部分同步就够了,仅仅传递 slave 在断开连接时丢失的这部分数据。
    # 这个值越大,salve 可以断开连接的时间就越长。
    # repl-backlog-size 1mb
    
    # After a master has no longer connected replicas for some time, the backlog
    # will be freed. The following option configures the amount of seconds that
    # need to elapse, starting from the time the last replica disconnected, for
    # the backlog buffer to be freed.
    #
    # Note that replicas never free the backlog for timeout, since they may be
    # promoted to masters later, and should be able to correctly "partially
    # resynchronize" with the replicas: hence they should always accumulate backlog.
    #
    # A value of 0 means to never release the backlog.
    #配置当master和slave失去联系多少秒之后,清空backlog释放空间。当配置成0时,表示永远不清空。
    # repl-backlog-ttl 3600
    
    # The replica priority is an integer number published by Redis in the INFO output.
    # It is used by Redis Sentinel in order to select a replica to promote into a
    # master if the master is no longer working correctly.
    #
    # A replica with a low priority number is considered better for promotion, so
    # for instance if there are three replicas with priority 10, 100, 25 Sentinel will
    # pick the one with priority 10, that is the lowest.
    #
    # However a special priority of 0 marks the replica as not able to perform the
    # role of master, so a replica with priority of 0 will never be selected by
    # Redis Sentinel for promotion.
    #
    # By default the priority is 100.
    #当 master 不能正常工作的时候,Redis Sentinel 会从 slaves 中选出一个新的 master,这个值越小,就越会被优先选中,但是如果是 0 , 那是意味着这个 slave 不可能被选中。 默认优先级为 100。
    replica-priority 100
    
    # It is possible for a master to stop accepting writes if there are less than
    # N replicas connected, having a lag less or equal than M seconds.
    #
    # The N replicas need to be in "online" state.
    #
    # The lag in seconds, that must be <= the specified value, is calculated from
    # the last ping received from the replica, that is usually sent every second.
    #
    # This option does not GUARANTEE that N replicas will accept the write, but
    # will limit the window of exposure for lost writes in case not enough replicas
    # are available, to the specified number of seconds.
    #
    # For example to require at least 3 replicas with a lag <= 10 seconds use:
    #
    # min-replicas-to-write 3
    # min-replicas-max-lag 10
    #
    # Setting one or the other to 0 disables the feature.
    #
    # By default min-replicas-to-write is set to 0 (feature disabled) and
    # min-replicas-max-lag is set to 10.
    
    # A Redis master is able to list the address and port of the attached
    # replicas in different ways. For example the "INFO replication" section
    # offers this information, which is used, among other tools, by
    # Redis Sentinel in order to discover replica instances.
    # Another place where this info is available is in the output of the
    # "ROLE" command of a master.
    #
    # The listed IP and address normally reported by a replica is obtained
    # in the following way:
    #
    # IP: The address is auto detected by checking the peer address
    # of the socket used by the replica to connect with the master.
    #
    # Port: The port is communicated by the replica during the replication
    # handshake, and is normally the port that the replica is using to
    # listen for connections.
    #
    # However when port forwarding or Network Address Translation (NAT) is
    # used, the replica may be actually reachable via different IP and port
    # pairs. The following two options can be used by a replica in order to
    # report to its master a specific set of IP and port, so that both INFO
    # and ROLE will report those values.
    #
    # There is no need to use both the options if you need to override just
    # the port or the IP address.
    #
    # replica-announce-ip 5.5.5.5
    # replica-announce-port 1234
    
    ################################## SECURITY ###################################
    
    # Require clients to issue AUTH <PASSWORD> before processing any other
    # commands. This might be useful in environments in which you do not trust
    # others with access to the host running redis-server.
    #
    # This should stay commented out for backward compatibility and because most
    # people do not need auth (e.g. they run their own servers).
    #
    # Warning: since Redis is pretty fast an outside user can try up to
    # 150k passwords per second against a good box. This means that you should
    # use a very strong password otherwise it will be very easy to break.
    # 设置Redis连接密码,如果配置了连接密码,客户端在连接Redis时需要通过AUTH <password>命令提供密码,默认关闭
    # requirepass foobared
    
    # Command renaming.
    #
    # It is possible to change the name of dangerous commands in a shared
    # environment. For instance the CONFIG command may be renamed into something
    # hard to guess so that it will still be available for internal-use tools
    # but not available for general clients.
    #
    # Example:
    #
    # rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52
    #
    # It is also possible to completely kill a command by renaming it into
    # an empty string:
    #
    # rename-command CONFIG ""
    #
    # Please note that changing the name of commands that are logged into the
    # AOF file or transmitted to replicas may cause problems.
    
    ################################### CLIENTS ####################################
    
    # Set the max number of connected clients at the same time. By default
    # this limit is set to 10000 clients, however if the Redis server is not
    # able to configure the process file limit to allow for the specified limit
    # the max number of allowed clients is set to the current file limit
    # minus 32 (as Redis reserves a few file descriptors for internal uses).
    #
    # Once the limit is reached Redis will close all the new connections sending
    # an error 'max number of clients reached'.
    #设置同一时间最大客户端连接数,Redis可以同时打开的客户端连接数为Redis进程可以打开的最大文件描述符数,
    #如果设置 maxclients 0,表示不作限制。当客户端连接数到达限制时,Redis会关闭新的连接并向客户端返回max number of clients reached错误信息
    # maxclients 10000
    
    ############################## MEMORY MANAGEMENT ################################
    
    # Set a memory usage limit to the specified amount of bytes.
    # When the memory limit is reached Redis will try to remove keys
    # according to the eviction policy selected (see maxmemory-policy).
    #
    # If Redis can't remove keys according to the policy, or if the policy is
    # set to 'noeviction', Redis will start to reply with errors to commands
    # that would use more memory, like SET, LPUSH, and so on, and will continue
    # to reply to read-only commands like GET.
    #
    # This option is usually useful when using Redis as an LRU or LFU cache, or to
    # set a hard memory limit for an instance (using the 'noeviction' policy).
    #
    # WARNING: If you have replicas attached to an instance with maxmemory on,
    # the size of the output buffers needed to feed the replicas are subtracted
    # from the used memory count, so that network problems / resyncs will
    # not trigger a loop where keys are evicted, and in turn the output
    # buffer of replicas is full with DELs of keys evicted triggering the deletion
    # of more keys, and so forth until the database is completely emptied.
    #
    # In short... if you have replicas attached it is suggested that you set a lower
    # limit for maxmemory so that there is some free RAM on the system for replica
    # output buffers (but this is not needed if the policy is 'noeviction').
    # 指定Redis最大内存限制,Redis在启动时会把数据加载到内存中,达到最大内存后,Redis会先尝试清除已到期或即将到期的Key,
    # 当此方法处理后,仍然到达最大内存设置,将无法再进行写入操作,但仍然可以进行读取操作。
    # Redis新的vm机制,会把Key存放内存,Value会存放在swap区
    # maxmemory <bytes>
    
    # MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
    # is reached. You can select among five behaviors:
    #
    # volatile-lru -> Evict using approximated LRU among the keys with an expire set.
    # allkeys-lru -> Evict any key using approximated LRU.
    # volatile-lfu -> Evict using approximated LFU among the keys with an expire set.
    # allkeys-lfu -> Evict any key using approximated LFU.
    # volatile-random -> Remove a random key among the ones with an expire set.
    # allkeys-random -> Remove a random key, any key.
    # volatile-ttl -> Remove the key with the nearest expire time (minor TTL)
    # noeviction -> Don't evict anything, just return an error on write operations.
    #
    # LRU means Least Recently Used
    # LFU means Least Frequently Used
    #
    # Both LRU, LFU and volatile-ttl are implemented using approximated
    # randomized algorithms.
    #
    # Note: with any of the above policies, Redis will return an error on write
    # operations, when there are no suitable keys for eviction.
    #
    # At the date of writing these commands are: set setnx setex syc
    # incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd
    # sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby
    # zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby
    # getset mset msetnx exec sort
    #
    # The default is:
    #当内存使用达到最大值时,redis使用的清除策略。有以下几种可以选择(明明有6种,官方配置文件里却说有5种可以选择?):
    # 1)volatile-lru   利用LRU算法移除设置过过期时间的key (LRU:最近使用 Least Recently Used ) 
    # 2)allkeys-lru   利用LRU算法移除任何key 
    # 3)volatile-random 移除设置过过期时间的随机key 
    # 4)allkeys-random  移除随机key 
    # 5)volatile-ttl   移除即将过期的key(minor TTL) 
    # 6)noeviction  不移除任何key,只是返回一个写错误 。默认选项
    
    # maxmemory-policy noeviction
    
    # LRU, LFU and minimal TTL algorithms are not precise algorithms but approximated
    # algorithms (in order to save memory), so you can tune it for speed or
    # accuracy. For default Redis will check five keys and pick the one that was
    # used less recently, you can change the sample size using the following
    # configuration directive.
    #
    # The default of 5 produces good enough results. 10 Approximates very closely
    # true LRU but costs more CPU. 3 is faster but not very accurate.
    # LRU 和 minimal TTL 算法都不是精准的算法,但是相对精确的算法(为了节省内存),随意你可以选择样本大小进行检测。redis默认选择5个样本进行检测,你可以通过maxmemory-samples进行设置样本数。
    # maxmemory-samples 5
    
    # Starting from Redis 5, by default a replica will ignore its maxmemory setting
    # (unless it is promoted to master after a failover or manually). It means
    # that the eviction of keys will be just handled by the master, sending the
    # DEL commands to the replica as keys evict in the master side.
    #
    # This behavior ensures that masters and replicas stay consistent, and is usually
    # what you want, however if your replica is writable, or you want the replica to have
    # a different memory setting, and you are sure all the writes performed to the
    # replica are idempotent, then you may change this default (but be sure to understand
    # what you are doing).
    #
    # Note that since the replica by default does not evict, it may end using more
    # memory than the one set via maxmemory (there are certain buffers that may
    # be larger on the replica, or data structures may sometimes take more memory and so
    # forth). So make sure you monitor your replicas and make sure they have enough
    # memory to never hit a real out-of-memory condition before the master hits
    # the configured maxmemory setting.
    #
    # replica-ignore-maxmemory yes
    
    ############################# LAZY FREEING ####################################
    
    # Redis has two primitives to delete keys. One is called DEL and is a blocking
    # deletion of the object. It means that the server stops processing new commands
    # in order to reclaim all the memory associated with an object in a synchronous
    # way. If the key deleted is associated with a small object, the time needed
    # in order to execute the DEL command is very small and comparable to most other
    # O(1) or O(log_N) commands in Redis. However if the key is associated with an
    # aggregated value containing millions of elements, the server can block for
    # a long time (even seconds) in order to complete the operation.
    #
    # For the above reasons Redis also offers non blocking deletion primitives
    # such as UNLINK (non blocking DEL) and the ASYNC option of FLUSHALL and
    # FLUSHDB commands, in order to reclaim memory in background. Those commands
    # are executed in constant time. Another thread will incrementally free the
    # object in the background as fast as possible.
    #
    # DEL, UNLINK and ASYNC option of FLUSHALL and FLUSHDB are user-controlled.
    # It's up to the design of the application to understand when it is a good
    # idea to use one or the other. However the Redis server sometimes has to
    # delete keys or flush the whole database as a side effect of other operations.
    # Specifically Redis deletes objects independently of a user call in the
    # following scenarios:
    #
    # 1) On eviction, because of the maxmemory and maxmemory policy configurations,
    # in order to make room for new data, without going over the specified
    # memory limit.
    # 2) Because of expire: when a key with an associated time to live (see the
    # EXPIRE command) must be deleted from memory.
    # 3) Because of a side effect of a command that stores data on a key that may
    # already exist. For example the RENAME command may delete the old key
    # content when it is replaced with another one. Similarly SUNIONSTORE
    # or SORT with STORE option may delete existing keys. The SET command
    # itself removes any old content of the specified key in order to replace
    # it with the specified string.
    # 4) During replication, when a replica performs a full resynchronization with
    # its master, the content of the whole database is removed in order to
    # load the RDB file just transferred.
    #
    # In all the above cases the default is to delete objects in a blocking way,
    # like if DEL was called. However you can configure each case specifically
    # in order to instead release memory in a non-blocking way like if UNLINK
    # was called, using the following configuration directives:
    
    lazyfree-lazy-eviction no
    lazyfree-lazy-expire no
    lazyfree-lazy-server-del no
    replica-lazy-flush no
    
    ############################## APPEND ONLY MODE ###############################
    
    # By default Redis asynchronously dumps the dataset on disk. This mode is
    # good enough in many applications, but an issue with the Redis process or
    # a power outage may result into a few minutes of writes lost (depending on
    # the configured save points).
    #
    # The Append Only File is an alternative persistence mode that provides
    # much better durability. For instance using the default data fsync policy
    # (see later in the config file) Redis can lose just one second of writes in a
    # dramatic event like a server power outage, or a single write if something
    # wrong with the Redis process itself happens, but the operating system is
    # still running correctly.
    #
    # AOF and RDB persistence can be enabled at the same time without problems.
    # If the AOF is enabled on startup Redis will load the AOF, that is the file
    # with the better durability guarantees.
    #
    # Please check http://redis.io/topics/persistence for more information.
    # 是否启用aof持久化方式 。否在每次更新操作后进行日志记录,Redis在默认情况下是异步的把数据写入磁盘,如果不开启,可能会在断电时导致一段时间内的数据丢失。
    # 因为 redis本身同步数据文件是按上面save条件来同步的,所以有的数据会在一段时间内只存在于内存中。默认为no
    appendonly no
    
    # The name of the append only file (default: "appendonly.aof")
    # 指定更新日志(aof)文件名,默认为appendonly.aof
    appendfilename "appendonly.aof"
    
    # The fsync() call tells the Operating System to actually write data on disk
    # instead of waiting for more data in the output buffer. Some OS will really flush
    # data on disk, some other OS will just try to do it ASAP.
    #
    # Redis supports three different modes:
    #
    # no: don't fsync, just let the OS flush the data when it wants. Faster.
    # always: fsync after every write to the append only log. Slow, Safest.
    # everysec: fsync only one time every second. Compromise.
    #
    # The default is "everysec", as that's usually the right compromise between
    # speed and data safety. It's up to you to understand if you can relax this to
    # "no" that will let the operating system flush the output buffer when
    # it wants, for better performances (but if you can live with the idea of
    # some data loss consider the default persistence mode that's snapshotting),
    # or on the contrary, use "always" that's very slow but a bit safer than
    # everysec.
    #
    # More details please check the following article:
    # http://antirez.com/post/redis-persistence-demystified.html
    #
    # If unsure, use "everysec".
    #指定更新日志条件,共有3个可选值: 
    # no:表示等操作系统进行数据缓存同步到磁盘(快,持久化没保证) 
    # always:同步持久化,每次发生数据变更时,立即记录到磁盘(慢,安全) 
    # everysec:表示每秒同步一次(默认值,很快,但可能会丢失一秒以内的数据)
    # appendfsync always
    appendfsync everysec
    # appendfsync no
    
    # When the AOF fsync policy is set to always or everysec, and a background
    # saving process (a background save or AOF log background rewriting) is
    # performing a lot of I/O against the disk, in some Linux configurations
    # Redis may block too long on the fsync() call. Note that there is no fix for
    # this currently, as even performing fsync in a different thread will block
    # our synchronous write(2) call.
    #
    # In order to mitigate this problem it's possible to use the following option
    # that will prevent fsync() from being called in the main process while a
    # BGSAVE or BGREWRITEAOF is in progress.
    #
    # This means that while another child is saving, the durability of Redis is
    # the same as "appendfsync none". In practical terms, this means that it is
    # possible to lose up to 30 seconds of log in the worst scenario (with the
    # default Linux settings).
    #
    # If you have latency problems turn this to "yes". Otherwise leave it as
    # "no" that is the safest pick from the point of view of durability.
    # 指定是否在后台aof文件rewrite期间调用fsync,默认为no,表示要调用fsync(无论后台是否有子进程在刷盘)。
    # Redis在后台写RDB文件或重写AOF文件期间会存在大量磁盘IO,此时,在某些linux系统中,调用fsync可能会阻塞。
    #如果应用系统无法忍受延迟,而可以容忍少量的数据丢失,则设置为yes。如果应用系统无法忍受数据丢失,则设置为no。
    no-appendfsync-on-rewrite no
    
    # Automatic rewrite of the append only file.
    # Redis is able to automatically rewrite the log file implicitly calling
    # BGREWRITEAOF when the AOF log size grows by the specified percentage.
    #
    # This is how it works: Redis remembers the size of the AOF file after the
    # latest rewrite (if no rewrite has happened since the restart, the size of
    # the AOF at startup is used).
    #
    # This base size is compared to the current size. If the current size is
    # bigger than the specified percentage, the rewrite is triggered. Also
    # you need to specify a minimal size for the AOF file to be rewritten, this
    # is useful to avoid rewriting the AOF file even if the percentage increase
    # is reached but it is still pretty small.
    #
    # Specify a percentage of zero in order to disable the automatic AOF
    # rewrite feature.
    #当AOF文件增长到一定大小的时候Redis能够调用 BGREWRITEAOF 对日志文件进行重写 。当AOF文件大小的增长率大于该配置项时自动开启重写。
    auto-aof-rewrite-percentage 100
    #当AOF文件增长到一定大小的时候Redis能够调用 BGREWRITEAOF 对日志文件进行重写 。当AOF文件大小大于该配置项时自动开启重写
    auto-aof-rewrite-min-size 64mb
    
    # An AOF file may be found to be truncated at the end during the Redis
    # startup process, when the AOF data gets loaded back into memory.
    # This may happen when the system where Redis is running
    # crashes, especially when an ext4 filesystem is mounted without the
    # data=ordered option (however this can't happen when Redis itself
    # crashes or aborts but the operating system still works correctly).
    #
    # Redis can either exit with an error when this happens, or load as much
    # data as possible (the default now) and start if the AOF file is found
    # to be truncated at the end. The following option controls this behavior.
    #
    # If aof-load-truncated is set to yes, a truncated AOF file is loaded and
    # the Redis server starts emitting a log to inform the user of the event.
    # Otherwise if the option is set to no, the server aborts with an error
    # and refuses to start. When the option is set to no, the user requires
    # to fix the AOF file using the "redis-check-aof" utility before to restart
    # the server.
    #
    # Note that if the AOF file will be found to be corrupted in the middle
    # the server will still exit with an error. This option only applies when
    # Redis will try to read more data from the AOF file but not enough bytes
    # will be found.
    #redis在启动时可以加载被截断的AOF文件,而不需要先执行redis-check-aof 工具。
    aof-load-truncated yes
    
    # When rewriting the AOF file, Redis is able to use an RDB preamble in the
    # AOF file for faster rewrites and recoveries. When this option is turned
    # on the rewritten AOF file is composed of two different stanzas:
    #
    # [RDB file][AOF tail]
    #
    # When loading Redis recognizes that the AOF file starts with the "REDIS"
    # string and loads the prefixed RDB file, and continues loading the AOF
    # tail.
    #是否开启混合持久化
    aof-use-rdb-preamble yes
    
    ################################ LUA SCRIPTING ###############################
    
    # Max execution time of a Lua script in milliseconds.
    #
    # If the maximum execution time is reached Redis will log that a script is
    # still in execution after the maximum allowed time and will start to
    # reply to queries with an error.
    #
    # When a long running script exceeds the maximum execution time only the
    # SCRIPT KILL and SHUTDOWN NOSAVE commands are available. The first can be
    # used to stop a script that did not yet called write commands. The second
    # is the only way to shut down the server in the case a write command was
    # already issued by the script but the user doesn't want to wait for the natural
    # termination of the script.
    #
    # Set it to 0 or a negative value for unlimited execution without warnings.
    #一个Lua脚本最长的执行时间,单位为毫秒,如果为0或负数表示无限执行时间
    lua-time-limit 5000
    
    ################################ REDIS CLUSTER ###############################
    #
    # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    # WARNING EXPERIMENTAL: Redis Cluster is considered to be stable code, however
    # in order to mark it as "mature" we need to wait for a non trivial percentage
    # of users to deploy it in production.
    # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    #
    # Normal Redis instances can't be part of a Redis Cluster; only nodes that are
    # started as cluster nodes can. In order to start a Redis instance as a
    # cluster node enable the cluster support uncommenting the following:
    # 是否开启cluster集群模式 如果配置yes则开启集群功能,此redis实例作为集群的一个节点,否则,它是一个普通的单一的redis实例。
    # cluster-enabled yes
    
    # Every cluster node has a cluster configuration file. This file is not
    # intended to be edited by hand. It is created and updated by Redis nodes.
    # Every Redis Cluster node requires a different cluster configuration file.
    # Make sure that instances running in the same system do not have
    # overlapping cluster configuration file names.
    #虽然此配置的名字叫"集群配置文件",但是此配置文件不能人工编辑,它是集群节点自动维护的文件,
    #主要用于记录集群中有哪些节点、他们的状态以及一些持久化参数等,方便在重启时恢复这些状态。通常是在收到请求之后这个文件就会被更新。
    # cluster-config-file nodes-6379.conf
    
    # Cluster node timeout is the amount of milliseconds a node must be unreachable
    # for it to be considered in failure state.
    # Most other internal time limits are multiple of the node timeout.
    #这是集群中的节点能够失联的最大时间,超过这个时间,该节点就会被认为故障。如果主节点超过这个时间还是不可达,则用它的从节点将启动故障迁移,升级成主节点。
    # cluster-node-timeout 15000
    
    # A replica of a failing master will avoid to start a failover if its data
    # looks too old.
    #
    # There is no simple way for a replica to actually have an exact measure of
    # its "data age", so the following two checks are performed:
    #
    # 1) If there are multiple replicas able to failover, they exchange messages
    # in order to try to give an advantage to the replica with the best
    # replication offset (more data from the master processed).
    # Replicas will try to get their rank by offset, and apply to the start
    # of the failover a delay proportional to their rank.
    #
    # 2) Every single replica computes the time of the last interaction with
    # its master. This can be the last ping or command received (if the master
    # is still in the "connected" state), or the time that elapsed since the
    # disconnection with the master (if the replication link is currently down).
    # If the last interaction is too old, the replica will not try to failover
    # at all.
    #
    # The point "2" can be tuned by user. Specifically a replica will not perform
    # the failover if, since the last interaction with the master, the time
    # elapsed is greater than:
    #
    # (node-timeout * replica-validity-factor) + repl-ping-replica-period
    #
    # So for example if node-timeout is 30 seconds, and the replica-validity-factor
    # is 10, and assuming a default repl-ping-replica-period of 10 seconds, the
    # replica will not try to failover if it was not able to talk with the master
    # for longer than 310 seconds.
    #
    # A large replica-validity-factor may allow replicas with too old data to failover
    # a master, while a too small value may prevent the cluster from being able to
    # elect a replica at all.
    #
    # For maximum availability, it is possible to set the replica-validity-factor
    # to a value of 0, which means, that replicas will always try to failover the
    # master regardless of the last time they interacted with the master.
    # (However they'll always try to apply a delay proportional to their
    # offset rank).
    #
    # Zero is the only value able to guarantee that when all the partitions heal
    # the cluster will always be able to continue.
    #如果设置成0,则无论从节点与主节点失联多久,从节点都会尝试升级成主节点。
    #如果设置成正数,则cluster-node-timeout乘以cluster-slave-validity-factor得到的时间,是从节点与主节点失联后,
    #此从节点数据有效的最长时间,超过这个时间,从节点不会启动故障迁移。
    #假设cluster-node-timeout=5,cluster-slave-validity-factor=10,则如果从节点跟主节点失联超过50秒,此从节点不能成为主节点。
    #注意,如果此参数配置为非0,将可能出现由于某主节点失联却没有从节点能顶上的情况,从而导致集群不能正常工作,
    #在这种情况下,只有等到原来的主节点重新回归到集群,集群才恢复运作。
    # cluster-replica-validity-factor 10
    
    # Cluster replicas are able to migrate to orphaned masters, that are masters
    # that are left without working replicas. This improves the cluster ability
    # to resist to failures as otherwise an orphaned master can't be failed over
    # in case of failure if it has no working replicas.
    #
    # Replicas migrate to orphaned masters only if there are still at least a
    # given number of other working replicas for their old master. This number
    # is the "migration barrier". A migration barrier of 1 means that a replica
    # will migrate only if there is at least 1 other working replica for its master
    # and so forth. It usually reflects the number of replicas you want for every
    # master in your cluster.
    #
    # Default is 1 (replicas migrate only if their masters remain with at least
    # one replica). To disable migration just set it to a very large value.
    # A value of 0 can be set but is useful only for debugging and dangerous
    # in production.
    #master的slave数量大于该值,slave才能迁移到其他孤立master上,如这个参数若被设为2,那么只有当一个主节点拥有2 个可工作的从节点时,它的一个从节点会尝试迁移。
    #不建议设置为0
    #想禁用可以设置一个非常大的值
    #如果小于0则启动失败
    # cluster-migration-barrier 1
    
    # By default Redis Cluster nodes stop accepting queries if they detect there
    # is at least an hash slot uncovered (no available node is serving it).
    # This way if the cluster is partially down (for example a range of hash slots
    # are no longer covered) all the cluster becomes, eventually, unavailable.
    # It automatically returns available as soon as all the slots are covered again.
    #
    # However sometimes you want the subset of the cluster which is working,
    # to continue to accept queries for the part of the key space that is still
    # covered. In order to do so, just set the cluster-require-full-coverage
    # option to no.
    # 表示当负责一个插槽的主库下线且没有相应的从库进行故障恢复时,是否整个集群不可用?
    # cluster-require-full-coverage yes
    
    # This option, when set to yes, prevents replicas from trying to failover its
    # master during master failures. However the master can still perform a
    # manual failover, if forced to do so.
    #
    # This is useful in different scenarios, especially in the case of multiple
    # data center operations, where we want one side to never be promoted if not
    # in the case of a total DC failure.
    # cluster-replica-no-failover no
    
    # In order to setup your cluster make sure to read the documentation
    # available at http://redis.io web site.
    
    ########################## CLUSTER DOCKER/NAT support ########################
    
    # In certain deployments, Redis Cluster nodes address discovery fails, because
    # addresses are NAT-ted or because ports are forwarded (the typical case is
    # Docker and other containers).
    #
    # In order to make Redis Cluster working in such environments, a static
    # configuration where each node knows its public address is needed. The
    # following two options are used for this scope, and are:
    #
    # * cluster-announce-ip
    # * cluster-announce-port
    # * cluster-announce-bus-port
    #
    # Each instruct the node about its address, client port, and cluster message
    # bus port. The information is then published in the header of the bus packets
    # so that other nodes will be able to correctly map the address of the node
    # publishing the information.
    #
    # If the above options are not used, the normal Redis Cluster auto-detection
    # will be used instead.
    #
    # Note that when remapped, the bus port may not be at the fixed offset of
    # clients port + 10000, so you can specify any port and bus-port depending
    # on how they get remapped. If the bus-port is not set, a fixed offset of
    # 10000 will be used as usually.
    #
    # Example:
    #
    # cluster-announce-ip 10.1.1.5
    # cluster-announce-port 6379
    # cluster-announce-bus-port 6380
    
    ################################## SLOW LOG ###################################
    
    # The Redis Slow Log is a system to log queries that exceeded a specified
    # execution time. The execution time does not include the I/O operations
    # like talking with the client, sending the reply and so forth,
    # but just the time needed to actually execute the command (this is the only
    # stage of command execution where the thread is blocked and can not serve
    # other requests in the meantime).
    #
    # You can configure the slow log with two parameters: one tells Redis
    # what is the execution time, in microseconds, to exceed in order for the
    # command to get logged, and the other parameter is the length of the
    # slow log. When a new command is logged the oldest one is removed from the
    # queue of logged commands.
    
    # The following time is expressed in microseconds, so 1000000 is equivalent
    # to one second. Note that a negative number disables the slow log, while
    # a value of zero forces the logging of every command.
    slowlog-log-slower-than 10000
    
    # There is no limit to this length. Just be aware that it will consume memory.
    # You can reclaim memory used by the slow log with SLOWLOG RESET.
    slowlog-max-len 128
    
    ################################ LATENCY MONITOR ##############################
    
    # The Redis latency monitoring subsystem samples different operations
    # at runtime in order to collect data related to possible sources of
    # latency of a Redis instance.
    #
    # Via the LATENCY command this information is available to the user that can
    # print graphs and obtain reports.
    #
    # The system only logs operations that were performed in a time equal or
    # greater than the amount of milliseconds specified via the
    # latency-monitor-threshold configuration directive. When its value is set
    # to zero, the latency monitor is turned off.
    #
    # By default latency monitoring is disabled since it is mostly not needed
    # if you don't have latency issues, and collecting data has a performance
    # impact, that while very small, can be measured under big load. Latency
    # monitoring can easily be enabled at runtime using the command
    # "CONFIG SET latency-monitor-threshold <milliseconds>" if needed.
    latency-monitor-threshold 0
    
    ############################# EVENT NOTIFICATION ##############################
    
    # Redis can notify Pub/Sub clients about events happening in the key space.
    # This feature is documented at http://redis.io/topics/notifications
    #
    # For instance if keyspace events notification is enabled, and a client
    # performs a DEL operation on key "foo" stored in the Database 0, two
    # messages will be published via Pub/Sub:
    #
    # PUBLISH __keyspace@0__:foo del
    # PUBLISH __keyevent@0__:del foo
    #
    # It is possible to select the events that Redis will notify among a set
    # of classes. Every class is identified by a single character:
    #
    # K Keyspace events, published with __keyspace@<db>__ prefix.
    # E Keyevent events, published with __keyevent@<db>__ prefix.
    # g Generic commands (non-type specific) like DEL, EXPIRE, RENAME, ...
    # $ String commands
    # l List commands
    # s Set commands
    # h Hash commands
    # z Sorted set commands
    # x Expired events (events generated every time a key expires)
    # e Evicted events (events generated when a key is evicted for maxmemory)
    # A Alias for g$lshzxe, so that the "AKE" string means all the events.
    #
    # The "notify-keyspace-events" takes as argument a string that is composed
    # of zero or multiple characters. The empty string means that notifications
    # are disabled.
    #
    # Example: to enable list and generic events, from the point of view of the
    # event name, use:
    #
    # notify-keyspace-events Elg
    #
    # Example 2: to get the stream of the expired keys subscribing to channel
    # name __keyevent@0__:expired use:
    #
    # notify-keyspace-events Ex
    #
    # By default all notifications are disabled because most users don't need
    # this feature and the feature has some overhead. Note that if you don't
    # specify at least one of K or E, no events will be delivered.
    notify-keyspace-events ""
    
    ############################### ADVANCED CONFIG ###############################
    
    # Hashes are encoded using a memory efficient data structure when they have a
    # small number of entries, and the biggest entry does not exceed a given
    # threshold. These thresholds can be configured using the following directives.
    hash-max-ziplist-entries 512
    hash-max-ziplist-value 64
    
    # Lists are also encoded in a special way to save a lot of space.
    # The number of entries allowed per internal list node can be specified
    # as a fixed maximum size or a maximum number of elements.
    # For a fixed maximum size, use -5 through -1, meaning:
    # -5: max size: 64 Kb <-- not recommended for normal workloads
    # -4: max size: 32 Kb <-- not recommended
    # -3: max size: 16 Kb <-- probably not recommended
    # -2: max size: 8 Kb <-- good
    # -1: max size: 4 Kb <-- good
    # Positive numbers mean store up to _exactly_ that number of elements
    # per list node.
    # The highest performing option is usually -2 (8 Kb size) or -1 (4 Kb size),
    # but if your use case is unique, adjust the settings as necessary.
    list-max-ziplist-size -2
    
    # Lists may also be compressed.
    # Compress depth is the number of quicklist ziplist nodes from *each* side of
    # the list to *exclude* from compression. The head and tail of the list
    # are always uncompressed for fast push/pop operations. Settings are:
    # 0: disable all list compression
    # 1: depth 1 means "don't start compressing until after 1 node into the list,
    # going from either the head or tail"
    # So: [head]->node->node->...->node->[tail]
    # [head], [tail] will always be uncompressed; inner nodes will compress.
    # 2: [head]->[next]->node->node->...->node->[prev]->[tail]
    # 2 here means: don't compress head or head->next or tail->prev or tail,
    # but compress all nodes between them.
    # 3: [head]->[next]->[next]->node->node->...->node->[prev]->[prev]->[tail]
    # etc.
    list-compress-depth 0
    
    # Sets have a special encoding in just one case: when a set is composed
    # of just strings that happen to be integers in radix 10 in the range
    # of 64 bit signed integers.
    # The following configuration setting sets the limit in the size of the
    # set in order to use this special memory saving encoding.
    set-max-intset-entries 512
    
    # Similarly to hashes and lists, sorted sets are also specially encoded in
    # order to save a lot of space. This encoding is only used when the length and
    # elements of a sorted set are below the following limits:
    zset-max-ziplist-entries 128
    zset-max-ziplist-value 64
    
    # HyperLogLog sparse representation bytes limit. The limit includes the
    # 16 bytes header. When an HyperLogLog using the sparse representation crosses
    # this limit, it is converted into the dense representation.
    #
    # A value greater than 16000 is totally useless, since at that point the
    # dense representation is more memory efficient.
    #
    # The suggested value is ~ 3000 in order to have the benefits of
    # the space efficient encoding without slowing down too much PFADD,
    # which is O(N) with the sparse encoding. The value can be raised to
    # ~ 10000 when CPU is not a concern, but space is, and the data set is
    # composed of many HyperLogLogs with cardinality in the 0 - 15000 range.
    hll-sparse-max-bytes 3000
    
    # Streams macro node max size / items. The stream data structure is a radix
    # tree of big nodes that encode multiple items inside. Using this configuration
    # it is possible to configure how big a single node can be in bytes, and the
    # maximum number of items it may contain before switching to a new node when
    # appending new stream entries. If any of the following settings are set to
    # zero, the limit is ignored, so for instance it is possible to set just a
    # max entires limit by setting max-bytes to 0 and max-entries to the desired
    # value.
    stream-node-max-bytes 4096
    stream-node-max-entries 100
    
    # 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 a hash table
    # that is rehashing, 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
    # actively rehash 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 from 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.
    activerehashing yes
    
    # The client output buffer limits can be used to force disconnection of clients
    # that are not reading data from the server fast enough for some reason (a
    # common reason is that a Pub/Sub client can't consume messages as fast as the
    # publisher can produce them).
    #
    # The limit can be set differently for the three different classes of clients:
    #
    # normal -> normal clients including MONITOR clients
    # replica -> replica clients
    # pubsub -> clients subscribed to at least one pubsub channel or pattern
    #
    # The syntax of every client-output-buffer-limit directive is the following:
    #
    # client-output-buffer-limit <class> <hard limit> <soft limit> <soft seconds>
    #
    # A client is immediately disconnected once the hard limit is reached, or if
    # the soft limit is reached and remains reached for the specified number of
    # seconds (continuously).
    # So for instance if the hard limit is 32 megabytes and the soft limit is
    # 16 megabytes / 10 seconds, the client will get disconnected immediately
    # if the size of the output buffers reach 32 megabytes, but will also get
    # disconnected if the client reaches 16 megabytes and continuously overcomes
    # the limit for 10 seconds.
    #
    # By default normal clients are not limited because they don't receive data
    # without asking (in a push way), but just after a request, so only
    # asynchronous clients may create a scenario where data is requested faster
    # than it can read.
    #
    # Instead there is a default limit for pubsub and replica clients, since
    # subscribers and replicas receive data in a push fashion.
    #
    # Both the hard or the soft limit can be disabled by setting them to zero.
    client-output-buffer-limit normal 0 0 0
    client-output-buffer-limit replica 256mb 64mb 60
    client-output-buffer-limit pubsub 32mb 8mb 60
    
    # Client query buffers accumulate new commands. They are limited to a fixed
    # amount by default in order to avoid that a protocol desynchronization (for
    # instance due to a bug in the client) will lead to unbound memory usage in
    # the query buffer. However you can configure it here if you have very special
    # needs, such us huge multi/exec requests or alike.
    #
    # client-query-buffer-limit 1gb
    
    # In the Redis protocol, bulk requests, that are, elements representing single
    # strings, are normally limited ot 512 mb. However you can change this limit
    # here.
    #
    # proto-max-bulk-len 512mb
    
    # Redis calls an internal function to perform many background tasks, like
    # closing connections of clients in timeout, purging expired keys that are
    # never requested, and so forth.
    #
    # Not all tasks are performed with the same frequency, but Redis checks for
    # tasks to perform according to the specified "hz" value.
    #
    # By default "hz" is set to 10. Raising the value will use more CPU when
    # Redis is idle, but at the same time will make Redis more responsive when
    # there are many keys expiring at the same time, and timeouts may be
    # handled with more precision.
    #
    # The range is between 1 and 500, however a value over 100 is usually not
    # a good idea. Most users should use the default of 10 and raise this up to
    # 100 only in environments where very low latency is required.
    hz 10
    
    # Normally it is useful to have an HZ value which is proportional to the
    # number of clients connected. This is useful in order, for instance, to
    # avoid too many clients are processed for each background task invocation
    # in order to avoid latency spikes.
    #
    # Since the default HZ value by default is conservatively set to 10, Redis
    # offers, and enables by default, the ability to use an adaptive HZ value
    # which will temporary raise when there are many connected clients.
    #
    # When dynamic HZ is enabled, the actual configured HZ will be used as
    # as a baseline, but multiples of the configured HZ value will be actually
    # used as needed once more clients are connected. In this way an idle
    # instance will use very little CPU time while a busy instance will be
    # more responsive.
    dynamic-hz yes
    
    # When a child rewrites the AOF file, if the following option is enabled
    # the file will be fsync-ed every 32 MB of data generated. This is useful
    # in order to commit the file to the disk more incrementally and avoid
    # big latency spikes.
    aof-rewrite-incremental-fsync yes
    
    # When redis saves RDB file, if the following option is enabled
    # the file will be fsync-ed every 32 MB of data generated. This is useful
    # in order to commit the file to the disk more incrementally and avoid
    # big latency spikes.
    rdb-save-incremental-fsync yes
    
    # Redis LFU eviction (see maxmemory setting) can be tuned. However it is a good
    # idea to start with the default settings and only change them after investigating
    # how to improve the performances and how the keys LFU change over time, which
    # is possible to inspect via the OBJECT FREQ command.
    #
    # There are two tunable parameters in the Redis LFU implementation: the
    # counter logarithm factor and the counter decay time. It is important to
    # understand what the two parameters mean before changing them.
    #
    # The LFU counter is just 8 bits per key, it's maximum value is 255, so Redis
    # uses a probabilistic increment with logarithmic behavior. Given the value
    # of the old counter, when a key is accessed, the counter is incremented in
    # this way:
    #
    # 1. A random number R between 0 and 1 is extracted.
    # 2. A probability P is calculated as 1/(old_value*lfu_log_factor+1).
    # 3. The counter is incremented only if R < P.
    #
    # The default lfu-log-factor is 10. This is a table of how the frequency
    # counter changes with a different number of accesses with different
    # logarithmic factors:
    #
    # +--------+------------+------------+------------+------------+------------+
    # | factor | 100 hits | 1000 hits | 100K hits | 1M hits | 10M hits |
    # +--------+------------+------------+------------+------------+------------+
    # | 0 | 104 | 255 | 255 | 255 | 255 |
    # +--------+------------+------------+------------+------------+------------+
    # | 1 | 18 | 49 | 255 | 255 | 255 |
    # +--------+------------+------------+------------+------------+------------+
    # | 10 | 10 | 18 | 142 | 255 | 255 |
    # +--------+------------+------------+------------+------------+------------+
    # | 100 | 8 | 11 | 49 | 143 | 255 |
    # +--------+------------+------------+------------+------------+------------+
    #
    # NOTE: The above table was obtained by running the following commands:
    #
    # redis-benchmark -n 1000000 incr foo
    # redis-cli object freq foo
    #
    # NOTE 2: The counter initial value is 5 in order to give new objects a chance
    # to accumulate hits.
    #
    # The counter decay time is the time, in minutes, that must elapse in order
    # for the key counter to be divided by two (or decremented if it has a value
    # less <= 10).
    #
    # The default value for the lfu-decay-time is 1. A Special value of 0 means to
    # decay the counter every time it happens to be scanned.
    #
    # lfu-log-factor 10
    # lfu-decay-time 1
    
    ########################### ACTIVE DEFRAGMENTATION #######################
    #
    # WARNING THIS FEATURE IS EXPERIMENTAL. However it was stress tested
    # even in production and manually tested by multiple engineers for some
    # time.
    #
    # What is active defragmentation?
    # -------------------------------
    #
    # Active (online) defragmentation allows a Redis server to compact the
    # spaces left between small allocations and deallocations of data in memory,
    # thus allowing to reclaim back memory.
    #
    # Fragmentation is a natural process that happens with every allocator (but
    # less so with Jemalloc, fortunately) and certain workloads. Normally a server
    # restart is needed in order to lower the fragmentation, or at least to flush
    # away all the data and create it again. However thanks to this feature
    # implemented by Oran Agra for Redis 4.0 this process can happen at runtime
    # in an "hot" way, while the server is running.
    #
    # Basically when the fragmentation is over a certain level (see the
    # configuration options below) Redis will start to create new copies of the
    # values in contiguous memory regions by exploiting certain specific Jemalloc
    # features (in order to understand if an allocation is causing fragmentation
    # and to allocate it in a better place), and at the same time, will release the
    # old copies of the data. This process, repeated incrementally for all the keys
    # will cause the fragmentation to drop back to normal values.
    #
    # Important things to understand:
    #
    # 1. This feature is disabled by default, and only works if you compiled Redis
    # to use the copy of Jemalloc we ship with the source code of Redis.
    # This is the default with Linux builds.
    #
    # 2. You never need to enable this feature if you don't have fragmentation
    # issues.
    #
    # 3. Once you experience fragmentation, you can enable this feature when
    # needed with the command "CONFIG SET activedefrag yes".
    #
    # The configuration parameters are able to fine tune the behavior of the
    # defragmentation process. If you are not sure about what they mean it is
    # a good idea to leave the defaults untouched.
    
    # Enabled active defragmentation
    # activedefrag yes
    
    # Minimum amount of fragmentation waste to start active defrag
    # active-defrag-ignore-bytes 100mb
    
    # Minimum percentage of fragmentation to start active defrag
    # active-defrag-threshold-lower 10
    
    # Maximum percentage of fragmentation at which we use maximum effort
    # active-defrag-threshold-upper 100
    
    # Minimal effort for defrag in CPU percentage
    # active-defrag-cycle-min 5
    
    # Maximal effort for defrag in CPU percentage
    # active-defrag-cycle-max 75
    
    # Maximum number of set/hash/zset/list fields that will be processed from
    # the main dictionary scan
    # active-defrag-max-scan-fields 1000
    
    
    展开全文
  • Ucos_II_中文注释版

    2018-07-11 23:12:17
    Ucos_II_中文注释版 Ucos_II_中文注释版
  • nginx源码中文注释版
  • freemodbus中文注释版

    2018-11-27 16:43:17
    阅读代码时我添加了很多中文注释。现在我把注释版发上来。 这些注释只是我对代码的理解,里面可能会有些用词不当甚至是理解错误的注释,请海涵。 注释是针对AVR的,其他平台版本应该也大同小异,大家对比着看。 若...
  • 下载后直接去本机jdk目录里替换jdk中的src.zip 再打开idea就能看到中文版的源码注释 示例 https://blog.csdn.net/a7459/article/details/106495622
  • 此为Phalcon1.3.0的官方文档的中文注释版本 对其中非常多的关键点进行了中文注释以使开发者更容易的学习Phalcon框架 本书的中文翻译可能见我的博客在陆续的更新中http://blog.csdn.net/qzfzz 此文件若侵犯了您的版权...
  • Linux0.11版本内核中文注释源代码
  • nginx源码,中文注释版

    2016-10-17 11:16:01
    nginx源码中文注释版 项目目标人群是是初学nginx源码的人员,欢迎提出更新的修改(请确保提交的文件编码为UTF8). 很多注释都是从网络上一些文章阅读后摘录出来的 做注释的同时也增加了文章地址说明 nginx学习资源...
  • PMBOK2008(第四)中文正式-注释版
  • SMBUS2.0英文手册,我加了很多中文注释,基本就是翻译了一遍
  • SMBUS1.1英文手册,我加了很多中文注释,基本就是翻译了一遍

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 3,382
精华内容 1,352
关键字:

中文版注释