{"success":true,"name":"vps-ram-audit","description":"Use when checking [PRIVATE_HOST] RAM. Rank process groups by PSS.","category":"brimind","path":"brimind/vps-ram-audit/SKILL.md","file":"SKILL.md","content":"---\nname: vps-ram-audit\ndescription: Use when checking [PRIVATE_HOST] RAM. Rank process groups by PSS.\n---\n\n- Use read-only `ssh -o ClearAllForwardings=yes -o BatchMode=yes <alias>` to avoid opening configured port forwards. Use `[PRIVATE_HOST]` for the user's Tunisian [PRIVATE_HOST] and `[PRIVATE_HOST]` for the production [PRIVATE_HOST]; don't substitute one for the other. For a quick RAM check, report total and available RAM, swap usage, and current paging; only rank processes when a workload breakdown is needed. Gather `free -m`, `/proc/pressure/memory` and short `vmstat` samples; disregard vmstat's first line when assessing current paging (it averages since boot).\n- For website latency vs swap, verify whether the [PRIVATE_HOST] is the app host or just the reverse proxy. Measure external browser navigation (TTFB, HTML complete, load event) with browser cache disabled and bracket the same batch with SSH `pswpin`/`pswpout` readings from `/proc/vmstat`. Report unchanged counters as no observed swap I/O, not a benchmark of active swap. Do not force memory pressure on the live host; `/proc/swaps` showing `/dev/null` on a [PRIVATE_HOST] does not identify the underlying swap device.\n- Rank current resident RAM by proportional set size (`Pss` in root-readable `/proc/<pid>/smaps_rollup`), not summed RSS, which double counts shared mappings. Use `SwapPss` separately. Group PM2 process trees by walking live PPid links to the roots from `[PATH]`; validate membership in `pm2-root.service` and keep unattributed processes separate. Resolve container cgroup IDs via read-only `docker ps`. Don't expose command-line arguments or PM2 environment values.\n- Keep cgroup `memory.current` totals separate from PSS: cgroups include cache/kernel charges and a PM2 aggregate overlaps its app rows. Report available RAM and pressure alongside swap occupancy. Use the colored comparison widget and sort the workload column numerically by RAM descending.\n- For BTX totals, include `dashcl` and `scamTokens` per the owner's classification. Check `fixTrustedScam` separately because it is a separate process from the same project. Known BTX PM2 names also include `Abot`, `botA`, `botAM`, `gap-multi`, and `botServerConfig`; verify which are running before summing. Keep `nouha1` out of BTX and distinguish a live process after a reported migration from a verified production route.\n- Rebooting a [PRIVATE_HOST] over SSH (`[PRIVATE_HOST]`/`[PRIVATE_HOST]`/`[PRIVATE_HOST]`): trigger with `ssh <alias> \"reboot\"`, or background it (`ssh <alias> '(sleep 1; reboot) >/dev/null 2>&1 & disown; echo reboot_triggered'`) so the command's own connection drop isn't mistaken for a failure. Right after, `ssh` to that host will show `Connection timed out during banner exchange` or `kex_exchange_identification: read: Connection reset by peer` for 20-60s — that is the box cycling, not a dead host. Confirm with `ping -c3 <ip>` (ICMP/the network path survives a reboot-in-progress before sshd is back) and poll `ssh <alias> \"uptime\"` every ~15-20s; treat it as back only once `uptime` succeeds and shows a small `up N min`. Don't declare the host down from one failed ssh attempt.\n","linked_files":[],"origin":"brimind","owner_id":null,"source":"router"}