How to tune tag view and tag write progress writing to cassandra

As the topic says, I am looking for ideas on how to tune my Cassandra persistence

This topic is based on a conversation between an anonymous user of Akka and our “Ask AI about Akka” bot in the documentation.

Tuning the writing of tag views and tag write progress in Cassandra involves adjusting several parameters in the Akka configuration. Here are some key points to consider:

  1. Eventual Consistency Delay: The default eventual-consistency-delay is set to 5s. This can be set much lower for latency-sensitive applications. However, setting this too low can decrease throughput and latency as more events will be missed initially and expensive searches carried out. You must test this to see if it has positive results for your use case.

akka.persistence.cassandra.events-by-tag.eventual-consistency-delay = 50ms

Source

  1. Flush Interval: It is possible to flush the tag writes right away. By default, they are batched and written as an unlogged batch which increases throughput. To write each individually without delay, set the flush-interval to 0s. Alternatively, set a very small value so some batching is done.

akka.persistence.cassandra.events-by-tag.flush-interval = 0s

Source

  1. Max Message Batch Size: The size of the batch is controlled via max-message-batch-size. The larger this value, the more efficient the tag writes will be but care must be taken not to have batches that will be rejected by Cassandra.

max-message-batch-size = 150

Source

  1. Tag Write Timeout: If the write to the tag_views table fails, it is retried. If it hasn’t succeeded within this timeout then the actor will be stopped and the write will be retried again to the tag_views table when the actor is restarted.

tag-write-timeout = 4s

Source

Remember, like with any tuning, testing should be done to see what works best for your environment. The values above may be too low or too high depending on the load and performance of your Cassandra cluster.