Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We've got a relatively low-traffic site (~1K pageviews/day) hosted on a single server, and expect it to grow significantly over the next few years.

I'm thinking of moving over to Rackspace CloudServer or EC2 and firing up 3 nodes (all on CentOS):

  • 2 x Web (Apache) - with loadbalancer
  • 1 x MySQL (for the Wordpress powered part)

The question is where to put Cassandra right now...

Should it sit on each Web node, or the MySQL node?

My thought right now is to put it on Web nodes. It's my understanding that Cassandra has the benefits of fault-tolerance (i.e. if we take a node down, the site is still operational). So even with only 2 nodes, we'd have that benefit as opposed to just putting it on the MySQL node.

Also, as we scale up and add another node, a cassandra instance can come along with it and the php can always run its queries on localhost. Is this a good idea?

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

One way to look at it would be identify what resources each app consumes and balance their usage across the nodes.

  • MySQL: Memory, Disk I/O, CPU
  • Apache: Memory, CPU
  • Cassandra: Memory, Disk I/O

From the above "back of a fag packet" i'd start with the premise Cassandra and Apache share, MySQL alone, and then pick holes in & refine that approach from that starting point.

share|improve this answer
add comment

Something to keep in mind, if you run Cassandra you'll want to decide between keeping everything inside the JVM and growing it as needed, or dropping in JNA and allowing your row cache to live in system memory.

Best practice these days is to run with JNA, because it also allows you to take snapshots with no memory footprint (since JNA permits java to set hard links), but once you start sharing non-JVM system memory between cassandra and other applications, you are likely to start crying silently to yourself in unguarded moments. If you can, consider running cassandra on separate machines.

But if not -- you only get fault tolerance in Cassandra if you have more than one node and your replication factor and consistency levels of reads and writes are properly calculated. For a three-node ring, if your main concern is fault-tolerance/data availability, I would set replication factor to 3 and your consistency level to ONE for reads and writes.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.