: Undefined array key "dark" in /www/wwwroot/wql_luoqin_ltd/wp-content/themes/Sakura/functions.php on line 694
class="post-template-default single single-post postid-1107 single-format-standard wp-custom-logo chinese-font ">
# Redis configuration file example. Units单位部分
2 #
3 # Note that in order to read the configuration file, Redis must be
4 # started with the file path as first argument:
5 #
6 # ./redis-server /path/to/redis.conf
7
8 # Note on units: when memory size is needed, it is possible to specify
9 # it in the usual form of 1k 5GB 4M and so forth:
10 #
11 # 1k => 1000 bytes
12 # 1kb => 1024 bytes
13 # 1m => 1000000 bytes
14 # 1mb => 1024*1024 bytes
15 # 1g => 1000000000 bytes
16 # 1gb => 1024*1024*1024 bytes
17 #
18 # units are case insensitive so 1GB 1Gb 1gB are all the same.
1,配置大小单位,开头定义一些基本的度量单位,只支持bytes,不支持bit
2,对大小写不敏感
二,includes
################################## INCLUDES ###################################
21
22 # Include one or more other config files here. This is useful if you
23 # have a standard template that goes to all Redis servers but also need
24 # to customize a few per-server settings. Include files can include
25 # other files, so use this wisely.
26 #
27 # Notice option "include" won't be rewritten by command "CONFIG REWRITE"
28 # from admin or Redis Sentinel. Since Redis always uses the last processed
29 # line as value of a configuration directive, you'd better put includes
30 # at the beginning of this file to avoid overwriting config change at runtime.
31 #
32 # If instead you are interested in using includes to override configuration
33 # options, it is better to use include as the last line.
34 #
35 # include /path/to/local.conf 包含的配置文件地址
36 # include /path/to/other.conf
################################# GENERAL #####################################
133
134 # By default Redis does not run as a daemon. Use 'yes' if you need it.
135 # Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
136 daemonize no //是否启动时使用守护线程配置为yes时以守护模式启动,这时redis instance会将进程号pid写入默认文件/var/run_6379/redis.pid。
137
145 # Note: these supervision methods only signal "process is ready."
146 # They do not enable continuous liveness pings back to your supervisor.
147 supervised no //可以通过upstart和systemd管理Redis守护进程,这个参数是和具体的操作系统相关的
148
157 # nothing bad happens, the server will start and run normally.
158 pidfile /var/run/redis_6379.pid //进程管道的pid配置文件位置
159
160 # Specify the server verbosity level.
161 # This can be one of:
162 # debug (a lot of information, useful for development/testing)
163 # verbose (many rarely useful info, but not a mess like the debug level)
164 # notice (moderately verbose, what you want in production probably)
165 # warning (only very important / critical messages are logged)
166 loglevel notice /日志级别
167
168 # Specify the log file name. Also the empty string can be used to force
169 # Redis to log on the standard output. Note that if you use standard
170 # output for logging but daemonize, logs will be sent to /dev/null
171 logfile "" //日志文件的输出目录默认是/dev/null
172
173 # To enable logging to the system logger, just set 'syslog-enabled' to yes,
174 # and optionally update the other syslog parameters to suit your needs.
175 # syslog-enabled no 是否将日志设置到系统日志中
176
177 # Specify the syslog identity.
178 # syslog-ident redis 设置系统日志的ID,就是日志名称
179
180 # Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7.
181 # syslog-facility local0 指定syslog的设备认证是local0-local7
182
183 # Set the number of databases. The default database is DB 0, you can select
184 # a different one on a per-connection basis using SELECT <dbid> where
185 # dbid is a number between 0 and 'databases'-1
186 databases 16 //设置数据库的数量,默认是16个,下标从零开始
# By default, if no "bind" configuration directive is specified, Redis listens
49 # for connections from all the network interfaces available on the server.
50 # It is possible to listen to just one or multiple selected interfaces using
51 # the "bind" configuration directive, followed by one or more IP addresses.
52 #
53 # Examples:
54 #
55 # bind 192.168.1.100 10.0.0.1 56 # bind 127.0.0.1 ::1
57 #
68 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
69 bind 127.0.0.1 默认情况下redis在server上的所有有效网络上监听客户端,如果我们想要让它一个或者多个 网络接口上监听,就绑定IP地址,多个IP空格分隔
87 # are explicitly listed using the "bind" directive.
88 protected-mode yes 禁止公网访问redis,开启有两条件 1,没有使用bind 2,没有设置访问密码
90 # Accept connections on the specified port, default is 6379 (IANA #815344).
91 # If port 0 is specified Redis will not listen on a TCP socket.
92 port 6379 设置redis的端口号
93
94 # TCP listen() backlog.
101 tcp-backlog 511 此参数确定了TCP连接中已完成队列(完成三次握手之后)的长度, 当然此值必须不大于Linux系统定义的/proc/sys/net/core/somaxconn值,默认是511,而Linux的默认参数值是128。当系统并发量大并且客户端速度缓慢的时候,可以将这二个参数一起参考设定
102
103 # Unix socket.
111
112 # Close the connection after a client is idle for N seconds (0 to disable)
113 timeout 0 当客户端闲置多少秒关闭连接,为0时表示关闭该功能
114
129 # Redis default starting with Redis 3.2.1.
130 tcp-keepalive 300 单位是秒,表示将周期性的使用SO_KEEPALIVE检测客户端是否还处于健康状态,避免出现 问题一直阻塞,官方给出的建议值是300S
################################ SNAPSHOTTING ################################ 197 198 # Save the DB on disk: 199 # 200 # save <seconds> <changes> 201 # 202 # Will save the DB if both the given number of seconds and the given 203 # number of write operations against the DB occurred. 204 # 205 # In the example below the behaviour will be to save: 206 # after 900 sec (15 min) if at least 1 key changed 207 # after 300 sec (5 min) if at least 10 keys changed 208 # after 60 sec if at least 10000 keys changed 209 # 210 # Note: you can disable saving completely by commenting out all "save" lines. 211 # 212 # It is also possible to remove all the previously configured save 213 # points by adding a save directive with a single empty string argument 214 # like in the following example: 216 # save "" 保存数据到磁盘。格式是:save <seconds> <changes> ,含义是在 seconds 秒之后至少有 changes个keys 发生改变则保存一次。 217 218 save 900 1 219 save 300 10 220 save 60 10000 221 222 # By default Redis will stop accepting writes if RDB snapshots are enabled 223 # (at least one save point) and the latest background save failed. 224 # This will make the user aware (in a hard way) that data is not persisting 225 # on disk properly, otherwise chances are that no one will notice and some 226 # disaster will happen. 227 # 228 # If the background saving process will start working again Redis will 229 # automatically allow writes again. 230 # 231 # However if you have setup your proper monitoring of the Redis server 232 # and persistence, you may want to disable this feature so that Redis will 233 # continue to work as usual even if there are problems with disk, 234 # permissions, and so forth. 235 stop-writes-on-bgsave-error yes 默认情况下,如果 redis 最后一次的后台保存失败,redis 将停止接受写操作,这样以一种强硬的方式让用户知道数据不能正确的持久化到磁盘, 否则就会没人注意到灾难的发生。 如果后台保存进程重新启动工作了,redis 也将自动的允许写操作。然而你要是安装了靠谱的监控,你可能不希望 redis 这样做,那你就改成 no 好了。 236 237 # Compress string objects using LZF when dump .rdb databases? 238 # For default that's set to 'yes' as it's almost always a win. 239 # If you want to save some CPU in the saving child set it to 'no' but 240 # the dataset will likely be bigger if you have compressible values or keys. 241 rdbcompression yes 是否在dump .rdb数据库的时候压缩字符串,默认设置为yes。如果你想节约一些cpu资源的话,可以把它设置为no,这样的话数据集就可能会比较大。 243 # Since version 5 of RDB a CRC64 checksum is placed at the end of the file. 244 # This makes the format more resistant to corruption but there is a performance 245 # hit to pay (around 10%) when saving and loading RDB files, so you can disable it 246 # for maximum performances. 248 # RDB files created with checksum disabled have a checksum of zero that will 249 # tell the loading code to skip the check. 250 rdbchecksum yes 是否CRC64校验rdb文件,会有一定的性能损失(大概10%) 252 # The filename where to dump the DB 253 dbfilename dump.rdb 设置rdb文件的名字。 255 # The working directory. 257 # The DB will be written inside this directory, with the filename specified 258 # above using the 'dbfilename' configuration directive. 259 # 260 # The Append Only File will also be created inside this directory. 261 262 # Note that you must specify a directory here, not a file name. 263 dir ./ 数据库存放目录。必须是一个目录,aof文件也会保存到该目录下
############################## MEMORY MANAGEMENT ################################
543 # Set a memory usage limit to the specified amount of bytes.
544 # When the memory limit is reached Redis will try to remove keys
545 # according to the eviction policy selected (see maxmemory-policy).
546 #
547 # If Redis can't remove keys according to the policy, or if the policy is
548 # set to 'noeviction', Redis will start to reply with errors to commands
549 # that would use more memory, like SET, LPUSH, and so on, and will continue
550 # to reply to read-only commands like GET.
551 #
552 # This option is usually useful when using Redis as an LRU or LFU cache, or to
553 # set a hard memory limit for an instance (using the 'noeviction' policy).
565 #
566 # maxmemory <bytes>
567
568 # MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
569 # is reached. You can select among five behaviors:
570 #
594 #
595 # The default is:
596 #
597 # maxmemory-policy noeviction 过期的策略默认永不过期,有5种策略
627 #
628 # replica-ignore-maxmemory yes
maxclients:设置客户端最大并发连接数,默认无限制,Redis可以同时打开的客户端连接数为Redis进程可以打开的最大文件描述符数-32(redis server自身会使用一些),如果设置 maxclients 0,表示不作限制。当客户端连接数到达限制时,Redis会关闭新的连接并向客户端返回max number of clients reached错误信息。
############################## APPEND ONLY MODE ###############################
680
681 # By default Redis asynchronously dumps the dataset on disk. This mode is
682 # good enough in many applications, but an issue with the Redis process or
683 # a power outage may result into a few minutes of writes lost (depending on
684 # the configured save points).
685 #
686 # The Append Only File is an alternative persistence mode that provides
687 # much better durability. For instance using the default data fsync policy
688 # (see later in the config file) Redis can lose just one second of writes in a
689 # dramatic event like a server power outage, or a single write if something
690 # wrong with the Redis process itself happens, but the operating system is
691 # still running correctly.
692 #
693 # AOF and RDB persistence can be enabled at the same time without problems.
694 # If the AOF is enabled on startup Redis will load the AOF, that is the file
695 # with the better durability guarantees.
696 #
697 # Please check http://redis.io/topics/persistence for more information.
698
699 appendonly no 是否使用AOF持久化模式,即是否每次更新操作进行日志记录,即采用异步的方式写入磁盘,如果不开启,断电时可能会数据丢失,它主要是弥补rdb的不足
700
701 # The name of the append only file (default: "appendonly.aof")
702
703 appendfilename "appendonly.aof" 设置更新操作的日志文件名默认是appendonly.aof
704
705 # The fsync() call tells the Operating System to actually write data on disk
706 # instead of waiting for more data in the output buffer. Some OS will really flush
707 # data on disk, some other OS will just try to do it ASAP.
708 #
709 # Redis supports three different modes:
710 #
711 # no: don't fsync, just let the OS flush the data when it wants. Faster.
712 # always: fsync after every write to the append only log. Slow, Safest.
713 # everysec: fsync only one time every second. Compromise.
714 #
715 # The default is "everysec", as that's usually the right compromise between
716 # speed and data safety. It's up to you to understand if you can relax this to
717 # "no" that will let the operating system flush the output buffer when
718 # it wants, for better performances (but if you can live with the idea of
719 # some data loss consider the default persistence mode that's snapshotting),
720 # or on the contrary, use "always" that's very slow but a bit safer than
721 # everysec.
722 #
723 # More details please check the following article:
724 # http://antirez.com/post/redis-persistence-demystified.html
725 #
726 # If unsure, use "everysec".
727
728 # appendfsync always
729 appendfsync everysec AOF文件的刷新频率方式有三种
730 # appendfsync no
731
732 # When the AOF fsync policy is set to always or everysec, and a background
733 # saving process (a background save or AOF log background rewriting) is
734 # performing a lot of I/O against the disk, in some Linux configurations
735 # Redis may block too long on the fsync() call. Note that there is no fix for
736 # this currently, as even performing fsync in a different thread will block
737 # our synchronous write(2) call.
738 #
739 # In order to mitigate this problem it's possible to use the following option
740 # that will prevent fsync() from being called in the main process while a
741 # BGSAVE or BGREWRITEAOF is in progress.
742 #
743 # This means that while another child is saving, the durability of Redis is
744 # the same as "appendfsync none". In practical terms, this means that it is
745 # possible to lose up to 30 seconds of log in the worst scenario (with the
746 # default Linux settings).
747 #
748 # If you have latency problems turn this to "yes". Otherwise leave it as
749 # "no" that is the safest pick from the point of view of durability.
750
751 no-appendfsync-on-rewrite no 指定是否在后台aof文件rewrite期间调用fsync,默认为no,表示要调用fsync(无论后台是否有子进程在刷盘)。Redis在后台写RDB文件或重写AOF文件期间会存在大量磁盘IO,此时,在某些linux系统中,调用fsync可能会阻塞。
752
753 # Automatic rewrite of the append only file.
754 # Redis is able to automatically rewrite the log file implicitly calling
755 # BGREWRITEAOF when the AOF log size grows by the specified percentage.
756 #
757 # This is how it works: Redis remembers the size of the AOF file after the
758 # latest rewrite (if no rewrite has happened since the restart, the size of
759 # the AOF at startup is used).
760 #
761 # This base size is compared to the current size. If the current size is
762 # bigger than the specified percentage, the rewrite is triggered. Also
763 # you need to specify a minimal size for the AOF file to be rewritten, this
764 # is useful to avoid rewriting the AOF file even if the percentage increase
765 # is reached but it is still pretty small.
766 #
767 # Specify a percentage of zero in order to disable the automatic AOF
768 # rewrite feature.
769
770 auto-aof-rewrite-percentage 100 当AOF文件增长到一定大小的时候Redis能够调用 BGREWRITEAOF 对日志文件进行重写 。当AOF文件大小的增长率大于该配置项时自动开启重写。
771 auto-aof-rewrite-min-size 64mb 当AOF文件增长到一定大小的时候Redis能够调用 BGREWRITEAOF 对日志文件进行重写 。当AOF文件大小大于该配置项时自动开启重写。
772
773 # An AOF file may be found to be truncated at the end during the Redis
774 # startup process, when the AOF data gets loaded back into memory.
775 # This may happen when the system where Redis is running
776 # crashes, especially when an ext4 filesystem is mounted without the
777 # data=ordered option (however this can't happen when Redis itself
778 # crashes or aborts but the operating system still works correctly).
780 # Redis can either exit with an error when this happens, or load as much
781 # data as possible (the default now) and start if the AOF file is found
782 # to be truncated at the end. The following option controls this behavior.
783 #
784 # If aof-load-truncated is set to yes, a truncated AOF file is loaded and
785 # the Redis server starts emitting a log to inform the user of the event.
786 # Otherwise if the option is set to no, the server aborts with an error
787 # and refuses to start. When the option is set to no, the user requires
788 # to fix the AOF file using the "redis-check-aof" utility before to restart
789 # the server.
790 #
791 # Note that if the AOF file will be found to be corrupted in the middle
792 # the server will still exit with an error. This option only applies when
793 # Redis will try to read more data from the AOF file but not enough bytes
794 # will be found.
795 aof-load-truncated yes redis在启动时可以加载被截断的AOF文件,而不需要先执行 redis-check-aof 工具
796
797 # When rewriting the AOF file, Redis is able to use an RDB preamble in the
798 # AOF file for faster rewrites and recoveries. When this option is turned
799 # on the rewritten AOF file is composed of two different stanzas:
800 #
801 # [RDB file][AOF tail]
802 #
803 # When loading Redis recognizes that the AOF file starts with the "REDIS"
804 # string and loads the prefixed RDB file, and continues loading the AOF
805 # tail.
806 aof-use-rdb-preamble yes
Comments | NOTHING
Warning: Undefined variable $return_smiles in /www/wwwroot/wql_luoqin_ltd/wp-content/themes/Sakura/functions.php on line 1109