Skip to content

Instantly share code, notes, and snippets.

@szepeviktor
Created November 25, 2025 11:50
Show Gist options
  • Select an option

  • Save szepeviktor/2f23726aeecf3655abc473160514e1e3 to your computer and use it in GitHub Desktop.

Select an option

Save szepeviktor/2f23726aeecf3655abc473160514e1e3 to your computer and use it in GitHub Desktop.
Monitoring CPU load on cPanel hosting
while :; do ps -u $USER -o pcpu= | awk '{sum+=$1} END {printf("%4.0f\n", sum)}'; sleep 1; done
@szepeviktor
Copy link
Copy Markdown
Author

ps -e -o comm=,rss= | awk '{sum[$1]+=$2} END {for (p in sum) printf "%-30s %10.1f MB\n", p, sum[p]/1024}' | sort -k2nr | head

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment