--- layout: docpage title: "Documentation" is_homepage: false is_sphinx_doc: true doc-parent: "Operating Cassandra" doc-title: "Snitch" doc-header-links: ' ' doc-search-path: "../search.html" extra-footer: ' ' ---
In cassandra, the snitch has two functions:
The dynamic snitch monitor read latencies to avoid reading from hosts that have slowed down. The dynamic snitch is
configured with the following properties on cassandra.yaml
:
dynamic_snitch
: whether the dynamic snitch should be enabled or disabled.dynamic_snitch_update_interval_in_ms
: controls how often to perform the more expensive part of host score
calculation.dynamic_snitch_reset_interval_in_ms
: if set greater than zero and read_repair_chance is < 1.0, this will allow
‘pinning’ of replicas to hosts in order to increase cache capacity.dynamic_snitch_badness_threshold:
: The badness threshold will control how much worse the pinned host has to be
before the dynamic snitch will prefer other replicas over it. This is expressed as a double which represents a
percentage. Thus, a value of 0.2 means Cassandra would continue to prefer the static snitch values until the pinned
host was 20% worse than the fastest.The endpoint_snitch
parameter in cassandra.yaml
should be set to the class the class that implements
IEndPointSnitch
which will be wrapped by the dynamic snitch and decide if two endpoints are in the same data center
or on the same rack. Out of the box, Cassandra provides the snitch implementations:
cassandra-topology.properties
exists,
it is used as a fallback, allowing migration from the PropertyFileSnitch.cassandra-topology.properties
.storage_port
or ssl_storage_port
on the public IP firewall
(For intra-Region traffic, Cassandra will switch to the private IP after establishing a connection).