From c150d653a47428cce3008e3b1ace2e3eff838821 Mon Sep 17 00:00:00 2001 From: kirito201922 <52266724+kirito201922@users.noreply.github.com> Date: Thu, 25 Dec 2025 20:44:50 +0100 Subject: [PATCH] add memory and disk usage checker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduces a script to report memory and disk usage of the Base node’s data directories, helping operators troubleshoot performance and storage issues. --- bin/check_resources.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 bin/check_resources.sh diff --git a/bin/check_resources.sh b/bin/check_resources.sh new file mode 100644 index 00000000..8ee657b1 --- /dev/null +++ b/bin/check_resources.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Inspect memory and disk usage relevant to a running Base node. +# Useful to determine if your host meets minimum requirements or if cleanup is needed. + +echo "== Base node resources ==" + +# Check available memory (Linux/macOS) +if command -v free >/dev/null 2>&1; then + free -h +else + echo "free command not found; skipping memory check" +fi + +echo +# Check disk usage under data directories +DATA_DIRS=( + "${BASE_RETH_DATA_DIR:-./reth-data}" + "${BASE_GETH_DATA_DIR:-./geth-data}" +) + +for dir in "${DATA_DIRS[@]}"; do + if [ -d "$dir" ]; then + du -sh "$dir" + fi +done + +echo +df -h . +echo +echo "Consider pruning or moving data directories if disk space is low."