summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Fankhauser hiddenalpha.ch2023-11-03 15:18:04 +0100
committerAndreas Fankhauser hiddenalpha.ch2023-11-03 15:18:04 +0100
commitda4b60cd0e7711f17055d8896f1fb5e820787c24 (patch)
treebc866da81e03682b14f4b7dbb6d5c2ecb0b155ca
parenta1cdf167a9c1eea7becb332498b83ec68b56aa7e (diff)
downloadUnspecifiedGarbage-da4b60cd0e7711f17055d8896f1fb5e820787c24.zip
UnspecifiedGarbage-da4b60cd0e7711f17055d8896f1fb5e820787c24.tar.gz
Add some OOM notes.
-rw-r--r--doc/note/openshift/dbg-mem-issues.txt27
1 files changed, 22 insertions, 5 deletions
diff --git a/doc/note/openshift/dbg-mem-issues.txt b/doc/note/openshift/dbg-mem-issues.txt
index 4babf7a..c7359fd 100644
--- a/doc/note/openshift/dbg-mem-issues.txt
+++ b/doc/note/openshift/dbg-mem-issues.txt
@@ -2,19 +2,20 @@
How to hunt memory issues in production
=======================================
-SVCNAME=foo-prod
-PID=42
-OC="oc -n whatever"
+true \
+ && SVCNAME=foo-prod \
+ && PID=9 \
+ && OC="oc -n foo" \
+ && MemLeakTry1="lua -W MemLeakTry1.lua" \
+ && true
${OC:?} exec -ti "$(${OC:?} get pods|egrep ston-1|cut -f1 -d' ')" -- pmap 9 > "${SVCNAME:?}"-pmap-$(date -u +%Y%m%d-%H%M%S).txt
-
${OC:?} exec -ti "$(${OC:?} get pods|egrep ston-1|cut -f1 -d' ')" -- sh -c 'true \
&& printf '\''%s\n'\'' "$(sed '\''s;^(.*)$;FOO;'\'' /proc/'${PID:?}'/smaps)" \
'
-
true \
&& ${OC:?} exec -ti "$(${OC:?} get pods|grep ston-[1-9]|cut -f1 -d' ')" -- sh -c 'true \
&& printf '\''h;PageSize;%s\n'\'' $(getconf PAGESIZE) \
@@ -28,5 +29,21 @@ true \
&& sleep $(expr 60 - \( $(date +%s) % 60 \)) || break; done' \
| tee "${SVCNAME:?}"-mem-$(date +%Y%m%d-%H%M%S%z).csv
+true \
+ && ONE="houston-prod-pmap-20231102-163425.txt" \
+ && TWO="houston-prod-pmap-20231103-074301.txt" \
+ && diff -U0 "${ONE:?}" "${TWO:?}" | egrep '^\+' | sed -r 's_\+([^ ]+) .*$_\1_'|sort|uniq \
+ && true
+
+(true \
+ && for F in $(ls *pmap*.txt); do true \
+ && printf "$F\n" \
+ && DATE="$(date +%s -d "$(echo $F|sed -r 's_.*([0-9]{4})([0-9]{2})([0-9]{2})-([0-9]{2})([0-9]{2})([0-9]{2}).*_\1-\2-\3T\4:\5:\6Z_')")" \
+ && <"$F" ${MemLeakTry1:?} --date "${DATE:?}" > "${F%.*}.csv" \
+ ;done)
+
+true \
+ && cat houston-prod-pmap-*.csv > houston-prod-pmapAll.csv \
+ && true