how to decide how many Cassandra nodes for deploy

每次都有评估产线需要多少Cassandra节点的需求,所以写几个简单的公式:

For Write:

Peak WPS For Application  * (Applications keyspace replicator factor / Total Cassandra Nodes Per DC)  >  Max WPS Capacity For Cassandra Single Node:  

For Read:

Precondition:

(1) Read Consistency level Take: LocalQuorum

(2) Every table take default configure:

Peak QPS For Application  * ((Applications keyspace replicator factor * 0.1 + (Applications keyspace replicator factor/2+1)*0.9 ) / Total Cassandra Nodes Per DC)  >  Max QPS Capacity For Cassandra Single Node:   

Take example:

For One Application On 7 nodes.

For Write:

Peak WPS For Application * (3 / 7 )  <  Max WPS Capacity For Cassandra Single Node:  

For Read:

Peak QPS For Application  * (2.1 / 7 )  <  Max QPS Capacity For Cassandra Single Node:  

In Short
So if deployed new Casandra DC:

The Cassandra node numbers > max (3* Peak WPS For Application/Max WPS Capacity For Cassandra Single Node, 2.1* Peak QPS For Application/Max QPS Capacity For Cassandra Single Node)

jvm startup parameters for trouble shooting

总是忘,然后每次都是现查现用,所以汇总记录下吧:

1.enable heapdump:

-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/heapdump.hprof -XX:OnOutOfMemoryError =”sh ~/cleanup.sh”

2.enable remote debug:

-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=n

3.enable GC log:
-Xloggc:/logs/`date +%F_%H-%M-%S`-gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCCause
-XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M

4.enable JMX:
-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=8091 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.password.file=/conf/jmxremote.password -Dcom.sun.management.jmxremote.access.file=/conf/jmxremote.access

5.enable Jprofiler:
-agentpath:/opt/jprofiler/bin/linux-x64/libjprofilerti.so=port=8849

6.enable EMMA:
-Demma.rt.control=true -Xverify:none -Demma.coverage.out.file=/opt/codecoverage_emma.ec