gpt4 book ai didi

redis - 如何在redis中为特定命令配置fsync

转载 作者:IT王子 更新时间:2023-10-29 06:11:26 26 4
gpt4 key购买 nike

我尝试查找有关自定义 AOF 配置的信息。我找到了 only that :

There are three options:

  1. fsync every time a new command is appended to the AOF. Very very slow, very safe.
  2. fsync every second. Fast enough (in 2.4 likely to be as fast as snapshotting), and you can lose 1 second of data if there is a disaster.
  3. Never fsync, just put your data in the hands of the Operating System. The faster and less safe method.

我可以配置 fsync 每次只为特定命令(INCR)将命令附加到 AOF 吗?可能吗?

最佳答案

您可以使用 MULTI/EXEC block 来做到这一点,即:

MULTI
CONFIG SET appendfsync always
INCR somekey
CONFIG SET appendfsync no
EXEC

关于redis - 如何在redis中为特定命令配置fsync,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33733533/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com