1. 程式人生 > >redisの存儲方式

redisの存儲方式

all avi 文件 als com 配置 you col ring

  • RDB存儲

    rdis database存儲方式,是將數據存儲在一個xxx.rdb的文件中。文件中保存的數據就是redis中的內存數據。默認的存儲方式,效率高,對磁盤的訪問比較合理,對內存數據的監控也是有一定臨界值的,保證數據盡可能不丟失。redis.conf

#   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
"" # 持久數據的規則. RDB持久規則. 存儲數據的文件由dbfilename參數決定 save 900 1 save 300 10 save 60 10000 # RDB持久數據的文件命名. 可以使用絕對路徑配置,如果沒有路徑配置,在命令運行的相對位置開始尋址存在。 dbfilename dump.rdb
  • AOF存儲

    append of file 存儲方式。對磁盤和IO的資源需求,比rdb方式高很多。對redis服務器的性能有很大的影響。Aof和rdb可以同時開啟,但是,在redis重啟的時候,會優先讀取aof中保存的數據變化日誌。不推薦同時啟用,對磁盤的壓力和IO的壓力太高。推薦使用rdb。

# 是否啟用append of file持久化方式.默認關閉.
# 每秒持久一次數據. 以追加的方式,持久到數據文件.
appendonly no

# aof持久方式的文件名稱.
appendfilename "appendonly.aof"

redisの存儲方式