Skip to content

Commit

Permalink
Update statistic.md
Browse files Browse the repository at this point in the history
  • Loading branch information
moisseev committed May 23, 2024
1 parent 2342e41 commit 384c6d1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions doc/configuration/statistic.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,22 @@ It's worth noting that Rspamd prioritizes SMTP recipients over MIME ones and giv

Starting from version 3.9, per-user statistics can be sharded over different Redis servers with the utilization of the [hash algorithm]({{ site.baseurl }}/doc/configuration/upstream.html#hash-algorithm).

Example of using two stand-alone masters shards without read replicas:
Example of using two stand-alone master shards without read replicas:
~~~hcl
servers = "hash:bayes-peruser-0-master,bayes-peruser-1-master";
~~~

Example of using a thee master-replicas shards setup:
Example of using a three master-replicas shards setup:
~~~hcl
write_servers = "hash:bayes-peruser-0-master,bayes-peruser-1-master,bayes-peruser-2-master";
read_servers = "hash:bayes-peruser-0-replica,bayes-peruser-1-replica,bayes-peruser-2-replica";
~~~

Important notes:
1. Changing shards count requires dropping all bayes statistics, so please take decisions wisely.
2. Each replica should have same position in `read_servers` as her master in `write_servers`; otherwise this will result in misaligned read-write hash slots assignment.
1. Changing shard count requires dropping all bayes statistics, so please make decisions wisely.
2. Each replica should have the same position in `read_servers` as its master in `write_servers`; otherwise, this will result in misaligned read-write hash slots assignment.
3. You can't use more than one replica per master in a sharded setup; this will result in misaligned read-write hash slots assignment.
4. You can't use Redis Sentinel for sharded setup.
4. You can't use Redis Sentinel for a sharded setup.
5. In the controller, you will see incorrect `Bayesian statistics` for the count of learns and users.

### Classifier and headers
Expand Down

0 comments on commit 384c6d1

Please sign in to comment.