Skip to content

Instantly share code, notes, and snippets.

@yukikaoru
Created March 22, 2011 13:51
Show Gist options
  • Save yukikaoru/881233 to your computer and use it in GitHub Desktop.
Save yukikaoru/881233 to your computer and use it in GitHub Desktop.
httpdの1プロセスあたりの最大使用メモリの取得
#!/bin/sh
pnums=`pgrep httpd | wc -l`
sum=`for p in \`pgrep httpd\`; do grep 'VmHWM' /proc/\$p/status; done | sort | awk '{sum = sum + \$2}END{print sum}'`
echo $(($sum / $pnums))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment