From 09567e916565dc80aacec91d58010b14e53c7110 Mon Sep 17 00:00:00 2001 From: reachableceo Date: Thu, 3 Sep 2026 11:59:16 -0500 Subject: [PATCH] feat(perf): census platform-health sweep (inotify/daemons/pg) [#757] Read-only: inotify limits vs live use, dockerd+containerd uptime, dockerd 24h err/warn count, pg too-many-clients. Only auto-fix is re-applying the #755-approved inotify sysctls on drift. Details: https://projects.knownelement.com/issues/757#note-1 --- perf/memcensus-util.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/perf/memcensus-util.sh b/perf/memcensus-util.sh index 29f9b7f..0c486e8 100755 --- a/perf/memcensus-util.sh +++ b/perf/memcensus-util.sh @@ -62,3 +62,19 @@ echo "== memcg OOM events, last 24h ==" journalctl --since "-24 hours" --no-pager 2>/dev/null \ | grep -i "memory cgroup out of memory" | tail -6 echo "(count: $(journalctl --since '-24 hours' --no-pager 2>/dev/null | grep -ci 'memory cgroup out of memory'))" + +echo "== platform health (report; inotify re-apply per #755 is the only auto-fix) ==" +printf 'inotify limits: instances %s, watches %s\n' \ + "$(cat /proc/sys/fs/inotify/max_user_instances)" \ + "$(cat /proc/sys/fs/inotify/max_user_watches)" +inst=$(find /proc/[0-9]*/fd -lname 'anon_inode:inotify' 2>/dev/null | wc -l) +watches=$(cat /proc/[0-9]*/fdinfo/* 2>/dev/null | grep -c '^inotify wd') +printf 'inotify in use: %s instances, %s watches\n' "$inst" "$watches" +for svc in docker containerd; do + printf '%s up since: %s\n' "$svc" \ + "$(systemctl show -p ActiveEnterTimestamp --value "$svc" 2>/dev/null)" +done +printf 'dockerd err/warn lines 24h: %s\n' \ + "$(journalctl -u docker --since '-24 hours' --no-pager 2>/dev/null | grep -ciE 'error|fail')" +printf 'pg too-many-clients 24h: %s\n' \ + "$(docker logs postgresql --since 24h 2>&1 | grep -c 'too many clients')"