Xiao Key
Xiao Key

Reputation: 33

How to solve the cassandra batch write to bring the performance problems

when I write to Cassandra in java, my cup usage up to 100%, Specific details are written below:

  1. I use 5 threads write to Cassandra cluster;
  2. each thread will establish a connection;
  3. Write 3000 data in batches at a time, each data is an average of 50KB.

This is the way I write to Cassandra in java: batch_insert_statement

Have you ever met this similar problem? could you tell me something about it? thanks a lot.

update. The following is my computer's details:

cpu-memory-details

Upvotes: 0

Views: 77

Answers (1)

ajith george
ajith george

Reputation: 598

You don't have to establish a connection for each thread. Initialize the connection once and allow the threads to utilize that. Establishing connection each time is a costly act.

Upvotes: 2

Related Questions