Some posts/papers discusses this in more detail. for example the one from 
thelastpickle:

https://thelastpickle.com/blog/2019/02/21/set-up-a-cluster-with-even-token-distribution.html

Which says:

Using statistical computation, the point where all clusters of any size always 
had a good token range balance was when 256 vnodes were used. Hence, the 
num_tokens default value of 256 was the recommended by the community to prevent 
hot spots in a cluster. The problem here is that the performance for operations 
requiring token-range scans (e.g. repairs, Spark operations) will tank big 
time. It can also cause problems with bootstrapping due to large numbers of 
SSTables generated. Furthermore, as Joseph Lynch and Josh Snyder pointed out in 
a 
http://mail-archives.apache.org/mod_mbox/cassandra-dev/201804.mbox/%3CCALShVHcz5PixXFO_4bZZZNnKcrpph-=5QmCyb0M=w-mhdyl...@mail.gmail.com%3E
 they wrote, the higher the value of num_tokens in large clusters, the higher 
the risk of data unavailability .





Sent using https://www.zoho.com/mail/







---- On Wed, 28 Apr 2021 10:43:35 +0430 Jai Bheemsen Rao Dhanwada 
<jaibheem...@gmail.com> wrote ----


Thank you,

Is there a specific reason why Cassandra4.0 recommends to use 16 tokens?



On Tue, Apr 27, 2021 at 11:11 PM Jeff Jirsa <mailto:jji...@gmail.com> wrote:



On Apr 27, 2021, at 10:47 PM, Jai Bheemsen Rao Dhanwada 
<mailto:jaibheem...@gmail.com> wrote:



Hello,


I am currently using num_tokens: 256 in my cluster with the version 3.11.6 and 
when I looked at the Cassandra4.0 I see the num_tokens set to 16. 



Is there a specific reason for changing the default value from 256 to 16? 

What is the best value to use ?






Probably something like 16 on new clusters. If you have an existing cluster, 
it’s likely not worth the hassle to change it unless it’s actively causing you 
pain 


If 16 is recommended, is there a way to change the num_tokens to 16 from 256 on 
the live production cluster?






Not easily, no. You have to add a new data center or similar. Lots of effort. 






I tried to directly update and restart Cassandra but the process won't startup 
with the below error



org.apache.cassandra.exceptions.ConfigurationException: Cannot change the 
number of tokens from 256 to 16



Any suggestions? 





Change the yaml back to 256 so it starts

Reply via email to