如何将Cassandra(> 2.0)JVM堆大小设置为8GB? [英] How to set Cassandra (>2.0) JVM heap size of 8GB?
问题描述
如何将Cassandra(> 2.0)JVM堆大小设置为8GB?当我键入free -m
时,将显示以下内容.如何将Cassandra JVM堆大小设置为8GB?
How to set Cassandra (>2.0) JVM heap size of 8GB? When I type in free -m
it gives me the following. How can I set the Cassandra JVM heap size to 8GB?
total used free shared buffers cached
Mem: 16047 11336 4711 0 81 5814
-/+ buffers/cache: 5441 10606
Swap: 0 0 0
推荐答案
如调整文档的Java资源部分:
如果您决定更改Java堆大小,则应在conf/cassandra-env.sh中一起设置MAX_HEAP_SIZE和HEAP_NEWSIZE.
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内,搜索以下行:
Inside cassandra-env.sh, search for this line:
#MAX_HEAP_SIZE="4G"
代码中的那一行在发生MAX_HEAP_SIZE计算之后发生,因此它可以作为替代.取消注释,然后进行相应设置.
That line in the code happens after the MAX_HEAP_SIZE calculations have happened, so it works as an override. Uncomment it, and set it accordingly.
MAX_HEAP_SIZE="8G"
请注意超过8G.有关调整JVM的指导,我建议 Amy Tobey的Cassandra 2.1调整指南.她提供了一些有关调整CMS的技巧,以及有关实施新G1GC的重要部分.
Be careful going above 8G. For guidance on tuning the JVM, I recommend Amy Tobey's Cassandra 2.1 Tuning Guide. She offers some tips for tuning CMS, as well as a great section on implementing the new G1GC.
这篇关于如何将Cassandra(> 2.0)JVM堆大小设置为8GB?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!