简体   繁体   中英

redis async replication of a bitset

I am using redis to store some pretty large bitsets. Redis is run in master/slave sentinel mode.

I got curious about the replication performance for very big bitsets (my bitset has a size of +-100Kbyte).

From the documentation: Async replication works by sending a stream of commands between master and slave.

Can I expect those commands to update a single bit in a slave or do they copy entire keys each time? Obviously I would prefer SETBIT commands to be passed instead of setting entire keys in order to decrease network traffic.

Async replication will only pass the write command eg SETBIT to the replica in most cases.

If the replica falls too far behind however, the replica will get flushed (cleared out) and a full resync will occur. This happens if there is a lot of latency and if there are a large number of writes. If you see this happening you can tune your replication buffers to lower the possibility of a full sync

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM