Skip to content

Commit 53b2cb5

Browse files
committed
Limiting metrics' JVM to match resource limits. Still getting OOMKilled though, but maybe half as often.
1 parent b3c6cd2 commit 53b2cb5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,4 @@ kubectl exec -c broker kafka-0 -- /bin/sh -c 'apk add --no-cache curl && curl ht
6969
kubectl logs -c metrics zoo-0
7070
kubectl exec -c zookeeper zoo-0 -- /bin/sh -c 'apk add --no-cache curl && curl http://localhost:5556/metrics'
7171
```
72+
Metrics containers can't be used for the curl because they're too short on memory.

zookeeper/51zoo.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ spec:
2121
image: solsson/kafka-prometheus-jmx-exporter@sha256:1f7c96c287a2dbec1d909cd8f96c0656310239b55a9a90d7fd12c81f384f1f7d
2222
command:
2323
- java
24+
- -Xms39M
25+
- -Xmx99M
2426
- -jar
2527
- jmx_prometheus_httpserver.jar
2628
- "5556"
@@ -41,9 +43,8 @@ spec:
4143
value: "5555"
4244
command:
4345
- /bin/bash
44-
- -c
46+
- -euc
4547
- >
46-
set -e;
4748
export ZOOKEEPER_SERVER_ID=$((${HOSTNAME##*-} + 4));
4849
echo "${ZOOKEEPER_SERVER_ID:-1}" | tee /var/lib/zookeeper/data/myid;
4950
sed -i "s/server\.$ZOOKEEPER_SERVER_ID\=[a-z0-9.-]*/server.$ZOOKEEPER_SERVER_ID=0.0.0.0/" config/zookeeper.properties;

0 commit comments

Comments
 (0)