What is the max(vnodes) num_token we can keep at one node ?
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!
6 People are following this question.
DataStax Enterprise is powered by the best distribution of Apache Cassandra ™
© 2023 DataStax, Titan, and TitanDB are registered trademarks of DataStax, Inc. and its subsidiaries in the United States and/or other countries.
Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries.
Privacy Policy Terms of Use