Apache Cassandra 4.0:ベンチマーク







Apache Cassandra 4.0 (. : 4, 2020), , JDK 11 . Apache Cassandra, , , ZGC — , JDK 11.







JDK 14 GA-, , Apache Cassandra. Apache Cassandra 3.11.6 4.0 , Shenandoah, Red Hat, . : Cassandra 4.0 , (ZGC Shenandoah) .









, tlp-cluster Apache Cassandra AWS tlp-stress — . , AWS.







r3.2xlarge - c3.2xlarge.







Apache Cassandra, .







tlp-cluster. , Reaper Medusa.







tlp-cluster , , :







# 3.11.6 CMS JDK8
build_cluster.sh -n CMS_3-11-6_jdk8 -v 3.11.6 --heap=16 --gc=CMS -s 1 -i r3.2xlarge --jdk=8 --cores=8

# 3.11.6 G1 JDK8
build_cluster.sh -n G1_3-11-6_jdk8 -v 3.11.6 --heap=31 --gc=G1 -s 1 -i r3.2xlarge --jdk=8 --cores=8

# 4.0 CMS JDK11
build_cluster.sh -n CMS_4-0_jdk11 -v 4.0~alpha4 --heap=16 --gc=CMS -s 1 -i r3.2xlarge --jdk=11 --cores=8

# 4.0 G1 JDK14
build_cluster.sh -n G1_4-0_jdk14 -v 4.0~alpha4 --heap=31 --gc=G1 -s 1 -i r3.2xlarge --jdk=14 --cores=8

# 4.0 ZGC JDK11
build_cluster.sh -n ZGC_4-0_jdk11 -v 4.0~alpha4 --heap=31 --gc=ZGC -s 1 -i r3.2xlarge --jdk=11 --cores=8

# 4.0 ZGC JDK14
build_cluster.sh -n ZGC_4-0_jdk14 -v 4.0~alpha4 --heap=31 --gc=ZGC -s 1 -i r3.2xlarge --jdk=14 --cores=8

# 4.0 Shenandoah JDK11
build_cluster.sh -n Shenandoah_4-0_jdk11 -v 4.0~alpha4 --heap=31 --gc=Shenandoah -s 1 -i r3.2xlarge --jdk=11 --cores=8
      
      





. , EC2.







Cassandra 3.11.6 Cassandra 4.0~alpha4 JDK :







#!/usr/bin/env bash

OLD=$1
NEW=$2
curl -sL https://github.com/shyiko/jabba/raw/master/install.sh | bash
. ~/.jabba/jabba.sh
jabba uninstall $OLD
jabba install $NEW
jabba alias default $NEW
sudo update-alternatives --install /usr/bin/java java ${JAVA_HOME%*/}/bin/java 20000
sudo update-alternatives --install /usr/bin/javac javac ${JAVA_HOME%*/}/bin/javac 20000
      
      





JDK jabba:







  • openjdk@1.11.0-2
  • openjdk@1.14.0
  • openjdk-shenandoah@1.8.0
  • openjdk-shenandoah@1.11.0


OpenJDK 8 Ubuntu apt.







java -version JDK, :







jdk8







openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~18.04-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
      
      





jdk8 Shenandoah







openjdk version "1.8.0-builds.shipilev.net-openjdk-shenandoah-jdk8-b712-20200629"
OpenJDK Runtime Environment (build 1.8.0-builds.shipilev.net-openjdk-shenandoah-jdk8-b712-20200629-b712)
OpenJDK 64-Bit Server VM (build 25.71-b712, mixed mode)
      
      





jdk11







openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
      
      





jdk11 Shenandoah







openjdk version "11.0.8-testing" 2020-07-14
OpenJDK Runtime Environment (build 11.0.8-testing+0-builds.shipilev.net-openjdk-shenandoah-jdk11-b277-20200624)
OpenJDK 64-Bit Server VM (build 11.0.8-testing+0-builds.shipilev.net-openjdk-shenandoah-jdk11-b277-20200624, mixed mode)
      
      





jdk14







openjdk version "14.0.1" 2020-04-14
OpenJDK Runtime Environment (build 14.0.1+7)
OpenJDK 64-Bit Server VM (build 14.0.1+7, mixed mode, sharing)
      
      





CMS



CMS (Concurrent Mark Sweep) — Apache Cassandra. JDK 14, JDK 8 11.







CMS :







-XX:+UseParNewGC
-XX:+UseConcMarkSweepGC
-XX:+CMSParallelRemarkEnabled
-XX:SurvivorRatio=8
-XX:MaxTenuringThreshold=1
-XX:CMSInitiatingOccupancyFraction=75
-XX:+UseCMSInitiatingOccupancyOnly
-XX:CMSWaitDuration=10000
-XX:+CMSParallelInitialMarkEnabled
-XX:+CMSEdenChunksRecordAlways
-XX:+CMSClassUnloadingEnabled
-XX:ParallelGCThreads=8
-XX:ConcGCThreads=8
-Xms16G
-Xmx16G
-Xmn8G
      
      





-XX:+UseParNewGC



JDK 11 . JVM .







CMS 16 , .







G1



G1GC ( Garbage-First) , CMS, , ( 24 ). , . , CMS, .







G1 :







-XX:+UseG1GC
-XX:G1RSetUpdatingPauseTimePercent=5
-XX:MaxGCPauseMillis=300
-XX:InitiatingHeapOccupancyPercent=70
-XX:ParallelGCThreads=8
-XX:ConcGCThreads=8
-Xms31G
-Xmx31G
      
      





4.0 JDK 14 G1.







31 , compressed oops .







ZGC



ZGC (Z Garbage Collector) — JDK, stop-the-world 10 . , , 16 . , , Apache Cassandra .







ZGC :







-XX:+UnlockExperimentalVMOptions
-XX:+UseZGC
-XX:ConcGCThreads=8
-XX:ParallelGCThreads=8
-XX:+UseTransparentHugePages
-verbose:gc
-Xms31G
-Xmx31G
      
      





-XX:+UseTransparentHugePages



, Linux. ZGC , , . , , .







ZGC compressed oops 32 . 31 , G1, .







Shenandoah



Shenandoah — Red Hat. JDK 8 11 mainline- OpenJDK Java 13.







ZGC, Shenandoah , .

Shenandoah :







-XX:+UnlockExperimentalVMOptions
-XX:+UseShenandoahGC
-XX:ConcGCThreads=8
-XX:ParallelGCThreads=8
-XX:+UseTransparentHugePages
-Xms31G
-Xmx31G
      
      





Shenandoah compressed oops, 32 .







Cassandra 4.0 JVM



Cassandra 4.0 jvm.options Java 8 Java 11, :







  • conf/jvm-server.options
  • conf/jvm8-server.options
  • conf/jvm11-server.options


4.0 jvm.options 3.11, jvm-server.options



, jvm8-server.options



jvm11-server.options



. .







jvm.options jvm-server.options



jvm8-server.options



. Java, , . , jvm11-server.options



JDK 8 JDK 11.









80/20%. tlp-stress , Cassandra -. 50 . keyspace 3, LOCAL_ONE.







Cassandra — 25, 40, 45 50 , — .







tlp-stress:







tlp-stress run BasicTimeSeries -d 30m -p 100M -c 50 --pg sequence -t 8 -r 0.2 --rate <desired rate> --populate 200000
      
      





30 , 5 16 compaction .







. Cassandra, - . , . , , Cassandra.









3.11.6, 25-40 /:













4.0, 25-40 /:













4.0, 45-50 /:



















Cassandra 3.11.6 41 , Cassandra 4.0 — 51, 25% . CMS. 4.0 , , , compaction (. CASSANDRA-14654, ).







Shenandoah jdk8 Cassandra 3.11.6 40 — . jdk11 Cassandra 4.0 — 49,6, CMS. G1 Shenandoah jdk 8 36/ Cassandra 3.11.6.







G1, , jdk14 , jdk11, — 47 50/.







ZGC jdk11, jdk14, 41/ .











































Shenandoah jdk8 Cassandra 3.11.6, .







CMS Cassandra 4.0 p99 (99- ) 11 31 50 . p99 17 Cassandra 3.11.6 11,5 Cassandra 4.0, 30%.







Cassandra 4.0 Cassandra 3.11.6 25–30% .







Shenandoah Cassandra 3.11.6, .







ZGC , jdk14, Shenandoah. Shenandoah p99 . Cassandra 4.0, — , . 2,64 p99 — . .







G1, , 300 p99, , .







Shenandoah p99 77% . 2,64 — . , . CMS Cassandra 3.11.6 85% p99!







ZGC jdk14, , , , . , Shenandoah.









G1 Cassandra — . Apache Cassandra 4.0, , , Shenandoah ZGC, .







Shenandoah Cassandra 3.11.6, , jdk11 Cassandra 4.0 .







, , Apache Cassandra , . , , Cassandra 3.11.6.







Apache 4 . Slack ASF.







: - Cassandra Day Russia 2021 27 . NoSQL-.



All Articles