Rohanil
Rohanil

Reputation: 1887

How many cassandra nodes can I run in docker container?

I have cassandra running in docker container. The container has max RAM of 12GB and 8 core CPU. I am fairly new to cassandra terms. I would like to know if I can run multiple nodes of cassandra in one container. If yes, then how many can I run? I read it in similar question's answers but this was not clear to me. My goal is to achieve write throughput of 1 million per second with cassandra. How many nodes, clusters should I build for this and is it possible to build all of it on one machine?

Upvotes: 3

Views: 737

Answers (1)

Christophe Schmitz
Christophe Schmitz

Reputation: 2996

Running multiple Cassandra process in the same docker container is not something desirable.

  • From a network perspective, they will all have the same IP, which is going to make it difficult to configure.
  • From a performance perspective, you will not achieve higher throughput, as your container will need to share the CPU, RAM, and IO. You could split the RAM usage by setting MAX_HEAP_SIZE (and HEAP_NEWSIZE) to split your 12GB amongst your cassandra process, yet they will all compete for the same CPU and IO available. You will better of running just one Cassandra service inside your container.
  • From a feature perspective, you don't achieve high availability, linear scalability which are important reasons why many companies choose Cassandra.

Overall, you should run your Cassandra cluster across multiple physical servers, you can dockerize Cassandra, but just run a single Cassandra service per container (set the MAX_HEAP_SIZE and HEAP_NEWSIZE to control memory usage), and a single container per server. One million write per second is not small. You will need a lot of servers to achieve that throughput. Depending on your replication factor, your consistency level, the size of your inserts, and the size of your server, you could be looking at 10s or 100s of servers...

Upvotes: 8

Related Questions