Skip to content

Instantly share code, notes, and snippets.

@Josh5
Created May 29, 2019 06:22
Show Gist options
  • Save Josh5/72c91d0719de13da293171790ec80c79 to your computer and use it in GitHub Desktop.
Save Josh5/72c91d0719de13da293171790ec80c79 to your computer and use it in GitHub Desktop.
Calculate process memory use
#!/bin/bash
#
# Credit: http://cloudinservice.com/tune-apache-performance-using-mpm-prefork-module/
#
ps -ylC ${1} | awk '{x += $8;y += 1} END {print "Process Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment