* remove peer argument from scrape swarm storage call * replace Peer field with netip.Addr in ScrapeRequest * add man for keydb storage * update readme
1.6 KiB
KeyDB Storage
This storage mainly the same as Redis and uses some of redis store logic with next exceptions:
-
keys such as
CHI_I,CHI_S_CandCHI_L_Cnot used (at all); -
peer TTL relies on KeyDB's EXPIREMEMBER command, so MoChi does not need to periodically check peer expiration;
-
storage does not execute periodical statistics collection (peer/lecher/info hash count) because:
- manual calculation (INC/DEC peers count) is not usable
- manual scan of all keys is quite expensive operation.
Use Case
KeyDB is fork of Redis, which allows to create active-active cluster and set set member expiration,
so this type of backend can be used to create fully symmetric cluster of tracker nodes with minimum
overkill to garbage collection.
Configuration
Configuration options are the same as redis's, BUT:
-
nameshould be set tokeydbinstead ofredis; -
gc_intervalandprometheus_reporting_intervaldon't have any sense.
mochi:
storage:
name: keydb
config:
...
Implementation
KeyDB storage uses same key names as redis (CHI_S4_<HASH>, CHI_L6_<HASH>...) to store peers,
but it is impossible to switch between storage providers without deleting these keys.
You can use redis storage type with KeyDB instance (KeyDB supports all Redis commands),
but not keydb storage type with Redis instance.