Comments:"rubytune — rails performance tuning, emergency troubleshooting, server and ops consulting"
Process Basics
All processes, with params + hierarchy
Show all ruby-related PIDs and processes
What is a process doing?
What files does a process have open?
(also nice to detect ruby version of a process)
Flavors of kill
Keep an eye on a process
Memory
Learn how to read output
First line is avg since boot
List the top 10 memory hogs
Detect OOM and other bad things
Disable OOM killer for a process
Disk/Files
Check reads/writes per disk
Files (often logs) marked for deletion but not yet deleted
Overview of all disks
Usage of this dir and all subdirs
Find files over 100MB
Low hanging fruit for free space.
Check /var/log too!
Find files created within the last 7 days
Find files older than 14 days
Delete files older than 14 days
Monitor a log file for an IP or anything else
Generate a large file (count * bs = total bytes)
Network
TCP sockets in use
Get IP/Ethernet info
host IP resolution
Curl, display headers (I), follow redirects (L)
Traceroute using TCP to avoid ICMP blockage
List any IP blocks/rules
Drop any network requests from IP
Show traffic by port
Show all ports listening with process PID
D/L speed test (don't run in prod! :)
Terminal & Screen
Start a screen session as the current user
Join/re-attach to a screen session
Record a terminal session
Playback a recorded terminal session
Tips n Tricks
Run Previous command as root
Change to last working dir
Run something forever