Many people have asked me about using the G1 garbage collector with Cassandra. Since most of my customers are running 2.0 in production the test is with 2.0 for now. Once I script it up I'll re-run the numbers with 2.1.
I also need to re-test with Java 7 and the Oracle JDKs.
G1 with "other" settings (see below) can beat CMS on latency and throughput on anemic CPUs if you set -XX:MaxGCPauseMillis=1000.
|Settings||Op/s||latency mean||latency median||latency p95||latency p99||latency p99.9||latency max|
- 6x Intel NUC 16GB RAM, quad-core @ 1.3Ghz, SSD
- Zulu OpenJDK 8
- Ubuntu 14.04 LTS Docker image (tobert/cassandra:2.0.13 w/ zulu openjdk)
- CoreOS 607.0 kernel 3.18.6
- /data is on an Intel mSATA SSD using ext4
cassandra-stress \ write \ n=50000000 \ cl=ONE \ -mode native cql3 \ -node 192.168.10.12
In the course of tuning for these workloads I've experimented on and off with the following settings. I'll need to break down which is providing what benefit later.
-XX:+AlwaysPreTouch -XX:+ResizeTLAB -XX:-UseBiasedLocking
(http://tobert.org/logs/cms-2Gnew-with-other.log.gz) (http://tobert.org/logs/cms-2Gnew-without-other.log.gz) (http://tobert.org/logs/g1-1000ms-with-other.log.gz) (http://tobert.org/logs/g1-1000ms-without-other.log.gz)