Configuring basic striping settings

The number of stripes can be configured for each instance of MemDB.

Note
How does the stripe count work?

To scale well on increasingly multi-core systems, it’s important to understand how the stripe count works:

  • Each MemDB stripe has a single commit order. While concurrent transactions (different events processed in parallel) execute concurrently against a single MemDB stripe, the commit protocol enforces an ordering, which means that no more than one commit at a time can occur against a single stripe.

  • While a single CPU can process thousands of commits per second, eventually a single commit order becomes a latency and scalability bottleneck.

  • Therefore, configuring a stripe count greater than 1 means that there is now more than 1 commit order — which means there is more scalability. So a stripe count of 8 means that up to 8 transactions can commit concurrently.

In summary, stripe count is the measure of commit concurrency.

Below are details on the default settings for stripe counts, and how to choose and set the stripe count for your MemDB instances.

Default settings

By default, Rhino disables data striping for all MemDB instances.

Choosing a stripe count

The stripe count must be 1 or greater, and must be a power of two (1, 2, 4, 8, 16, …​). The stripe count should be proportional to the number of CPU cores in a server. A good rule of thumb is that the stripe count should be about 1/2 the number of CPU cores.

To disable striping, use a stripe count of 1.

In some cases when nodes are regularly leaving and joining a cluster, there is a chance of all cluster nodes being restarted as a result of striping being enabled.

Warning We recommend that you consult with OpenCloud before enabling striping to ensure it is configured correctly in a stable and consistent network.

Setting the stripe count

Each MemDB instance has its own stripe count. To configure the stripe count for a particular MemDB instance, you edit the MemDB configuration for that instance, in the config/rhino-config.xml file in each Rhino node directory.

Warning The stripe count for a MemDB instance must be the same on all nodes in the cluster. A new node will not start if it contains a stripe count which is inconsistent with other nodes in the cluster. Therefore, the stripe count cannot be changed while a cluster is running.

The striping configuration for a local MemDB instance looks like this:

<memdb-local>
  ...
  <stripe-count>8</stripe-count>
</memdb-local>

The striping configuration for a replicated MemDB instance looks like this:

<memdb>
  ...
  <stripe-count>8</stripe-count>
</memdb>

Advanced configuration: using a stripe offset

It is possible (though very uncommon), to configure a stripe offset for replicated MemDB instances.

Note
What is a "stripe offset"?

Each replicated MemDB declares which Savanna group it runs on. For example:

<memdb>
  ...
  <group-name>rhino-db</group-name>
  ...
</memdb>

When using data striping, each stripe runs on a separate Savanna group. By default, these groups are zero-indexed, taking names (in this example) such as rhino-db.0, rhino-db.1, rhino-db.2, and so on.

A stripe offset raises the index of the first stripe. So, for example, a stripe offset of 4 would result in Savanna group names (in this example) such as rhino-db.4, rhino-db.5, rhino-db.6, and so on.

Below are details on when to consider using and how to set a stripe offset.

When should I use a stripe offset?

Very likely, never. The combination of Savanna group name and stripe offset allow an administrator greater flexibility in mapping data stripes to groups.

Typically, when choosing which Savanna groups to use for MemDB, use of the group-name should be sufficient. To run multiple MemDB instances on the same Savanna group, configure them with the same group-name value. To run multiple MemDB instances on different Savanna groups, configure them with different group-name values.

How do I set the stripe offset?

The default stripe offset is 0.

To change the offset for a particular MemDB instance, edit the MemDB configuration for that instance in the config/rhino-config.xml file, in each Rhino node directory, adding a stripe-offset element.

Warning The stripe offset for a MemDB instance must be the same on all nodes in the cluster. A new node will not start if it contains a stripe offset which is inconsistent with other nodes in the cluster. Therefore, the stripe offset cannot be changed while a cluster is running.

The stripe offset configuration for a replicated MemDB instance looks like this:

<memdb>
  ...
  <stripe-count>8</stripe-count>
  <stripe-offset>4</stripe-offset>
</memdb>
Previous page Next page
Rhino Version 2.7.0