Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

satvantsingh_190085 avatar image
satvantsingh_190085 asked ·

What is the maximum vnodes per node?

What is the max(vnodes) num_token we can keep at one node ?

cassandratokenvnodes
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered ·

The maximum number of tokens configurable per node in Cassandra is 1,536.

For reference, here is the configuration in DatabaseDescriptor.java in C* 3.11.6:

    private static final int MAX_NUM_TOKENS = 1536;

However, we don't recommend assigning a large number of tokens to nodes. It is no longer recommended to assign 256 as it was for a number of years since large values impact the performance of nodes and operations such as repairs.

The recommendation is to allocate either 8 or 16 num_tokens per node. There will be a slight skew in the distribution of data but the algorithm for allocate_tokens_for_keyspace should offset it. If unbalanced data is a real concern, assign 32 tokens but be aware of the tradeoffs. As always, you should test exhaustively based on your use case, data model and expected access patterns. Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.