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 |
---|---|---|---|---|---|---|---|
G1+other | 74379 | 2.7 | 1.7 | 4.9 | 7.5 | 21.7 | 2901.2 |
G1-other | 72116 | 2.8 | 1.7 | 5.0 | 7.7 | 24.3 | 1088.2 |
CMS+other | 65681 | 3.0 | 1.5 | 4.7 | 7.7 | 276.9 | 1848.0 |
CMS-other | 62196 | 3.2 | 1.6 | 5.1 | 8.3 | 185.8 | 1615.3 |
CMS-other | 64973 | 3.1 | 1.5 | 4.7 | 7.4 | 127.6 | 1645.7 |
- 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)