Skip to content

Instantly share code, notes, and snippets.

@hermes-pimentel
Last active September 15, 2016 16:25
Show Gist options
  • Save hermes-pimentel/0e987b0c8a5cee05e09e00890aab3e76 to your computer and use it in GitHub Desktop.
Save hermes-pimentel/0e987b0c8a5cee05e09e00890aab3e76 to your computer and use it in GitHub Desktop.
ps aux | grep 'httpd' | awk '{print "PID ->" $2 " MEM ->" $6/1024 " MB";}'
watch -n 1 "echo -n 'Apache Processes: ' && ps -C httpd --no-headers | wc -l && free -m"
ps -ylC httpd --sort:rss | awk '{sum+=$8; ++n} END {print "Tot="sum"("n")";print "Avg="sum"/"n"="sum/n/1024"MB"}'
1) process tree
pstree -p | grep httpd
2) sessions memory
ps aux | grep 'httpd' | awk '{print "PID ->" $2 " MEM ->" $6/1024 " MB";}'
3) run strace
strace -p 6450 -ff -o http-trace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment