File tree 2 files changed +19
-1
lines changed
2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,18 @@ LOGBACK_org_elassandra_cluster_service
90
90
LOGBACK_org_elasticsearch
91
91
```
92
92
93
+ ### cgroup memory limit
94
+
95
+ If CASSANDRA_CGROUP_MEMORY_LIMIT is set to ** true** (default is ** false** ),
96
+ add the following JVM properties to the /etc/cassandra/jvm.options file.
97
+ This will restrict maximum heap size to cgroup limit.
98
+
99
+ ```
100
+ -XX:+UnlockExperimentalVMOptions
101
+ -XX:+UseCGroupMemoryLimitForHeap
102
+ -XX:MaxRAMFraction=2
103
+ ```
104
+
93
105
### Kubernetes
94
106
95
107
A ** ready_probe.sh** script can be used for readiness probe as follow:
Original file line number Diff line number Diff line change @@ -159,7 +159,13 @@ if [ "$1" = 'cassandra' ]; then
159
159
if [ " $LOCAL_JMX " = " no" ]; then
160
160
export JVM_OPTS=" $JVM_OPTS -Djava.rmi.server.hostname=$POD_IP "
161
161
fi
162
-
162
+
163
+ : ${CASSANDRA_CGROUP_MEMORY_LIMIT=' false' }
164
+
165
+ # Specifies if heap size should be limited by cgroup constraints
166
+ if [ " ${CASSANDRA_CGROUP_MEMORY_LIMIT} " = ' true' ]; then
167
+ export JVM_OPTS=" $JVM_OPTS -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:MaxRAMFraction=2"
168
+ fi
163
169
fi
164
170
165
171
exec " $@ "
You can’t perform that action at this time.
0 commit comments