What is the batch limit in Cassandra?

前端 未结 3 1204
有刺的猬
有刺的猬 2020-12-05 23:12

I have a Java client that pushes (INSERT) records in batch to Cassandra cluster. The elements in the batch all have the same row key, so they all will be placed in the same

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-05 23:58

    I would recommend not increasing the cap, and just splitting into multiple requests. Putting everything in a giant single request will negatively impact the coordinator significantly. Having everything in one partition can improve the throughput in some sized batches by reducing some latency, but batches are never meant to be used to improve performance. So trying to optimize to get maximum throughput by using different batch sizes will depend largely on use case/schema/nodes and will require specific testing, since there's generally a cliff on the size where it starts to degrade.

    There is a

    # Fail any batch exceeding this value. 50kb (10x warn threshold) by default.
    batch_size_fail_threshold_in_kb: 50
    

    option in your cassandra.yaml to increase it, but be sure to test to make sure your actually helping and not hurting your throughput.

提交回复
热议问题