如何将 Cassandra (>2.0) JVM 堆大小设置为 8GB?当我输入 free -m
时,它会给我以下信息。如何将 Cassandra JVM 堆大小设置为 8GB?
total used free shared buffers cached
Mem: 16047 11336 4711 0 81 5814
-/+ buffers/cache: 5441 10606
Swap: 0 0 0
最佳答案
如 Tuning Java resources 中所述文档部分:
If you decide to change the Java heap sizing, both MAX_HEAP_SIZE and HEAP_NEWSIZE should should be set together in conf/cassandra-env.sh.
在 cassandra-env.sh 中,搜索这一行:
#MAX_HEAP_SIZE="4G"
代码中的那一行发生在 MAX_HEAP_SIZE 计算发生之后,因此它可以作为覆盖。取消注释,并相应地进行设置。
MAX_HEAP_SIZE="8G"
小心超过 8G。有关调整 JVM 的指导,我推荐 Amy Tobey's Cassandra 2.1 Tuning Guide .她提供了一些调优 CMS 的技巧,以及关于实现新 G1GC 的精彩部分。
关于java - 如何将 Cassandra (>2.0) JVM 堆大小设置为 8GB?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34745419/