> 文档中心 > Redis配置文件

Redis配置文件

Redis中的配置文件中每个参数的分析

Redis.config分析:网络bind 127.0.0.1 #绑定的ipprotected-mode yes #保护模式port 6379 #端口设置通用daemonize yes # 以守护线程方式运行(后台运行)pidfile /var/run/redis_6379.pid #如果开启后台运行,需要指定一个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)loglevel noticelogfile "" #日志文件名称databases 16 #默认的数据库数量快照#持久化规则save 900 1#如果900秒内,有至少一个key发生修改,就进行持久化操作save 300 10save 60 10000 stop-writes-on-bgsave-error yes#持久化发生错误后是否继续工作rdbcompression yes #是否压缩rdb文件,rdbchecksum yes#校验rdb文件dir ./#rdb文件保存目录maxmemory #最大内存设置maxmemory-policy noeviction#内存到达上限的处理策略appendonly no#默认不开启aof模式,默认是rdb方式持久化的,在大部分情况下个,rdb是够用的