In Redis Enterprise Software (RS), the location of master and slave shards on the cluster nodes can impact the database and node performance. Master shards and their corresponding slave shards are always placed on separate nodes for data resiliency. The shard placement policy helps to maintain optimal performance and resiliency.

In addition to the shard placement policy, considerations that determine shard placement are:

  • Separation of master and slave shards
  • Available persistence and Redis on Flash (RoF) storage
  • Rack awareness
  • Memory available to host the database when fully populated

The shard placement policies are:

  • dense - Place as many shards as possible on the smallest number of nodes to reduce the latency between the proxy and the database shards; Recommended for Redis on RAM databases to optimize memory resources
  • sparse - Spread the shards across as many nodes in the cluster as possible to spread the traffic across cluster nodes; Recommended for Redis on Flash databases to optimize disk resources

When you create an RS cluster, the default shard placement policy (dense) is assigned to all databases that you create on the cluster. You can:

  • Change the default shard placement policy for the cluster to sparse so that the cluster applies that policy to all databases that you create
  • Change the shard placement policy for each database after the database is created

Default Shard Placement Policy

When you create a new cluster, the cluster configuration has a dense default shard placement policy. When you create a database, this default policy is applied to the new database.

To see the current default shard placement policy, run rladmin info cluster:

shard_placement_info_cluster

To change the default shard placement policy so that new databases are created with the sparse shard placement policy, run:

tune cluster default_shards_placement [ dense | sparse ]

Shard Placement Policy for a Database

To see the shard placement policy for a database in rladmin status.

shard_placement_rladmin_status

To change the shard placement policy for a database, run:

rladmin placement db db1 [ dense | sparse ]