Reputation: 33
when I write to Cassandra in java, my cup usage up to 100%, Specific details are written below:
- I use 5 threads write to Cassandra cluster;
- each thread will establish a connection;
- 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:
Upvotes: 0
Views: 77
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