To TOP or NOT to TOP www.SAS.com
To TOP or NOT to TOP Using the TOP command in Linux By Len van den Berg SAS Grid Platform Administrator
Monitoring Processes in Linux • By User • By CPU • By Size • By Command • By Memory • By Status
The TOP command - Pro’s • Live output monitoring • Sorting capability • Highlighting running processes • Single out processes by User • Single out process by PID • Edit refresh rate • See processes by Command
Starting TOP • Open your PUTTY session $>... • Type: top • Watch the magic happen…
$>top
What’s innit 4 me? – pt 1 • PID – Process ID • USER – Who’s dunnit? • PR – Priority value • NI – NICE value • VIRT – Virtual Memory used • RES – Physical Memory used • SHR – Shared Memory used • S – Status (S = Sleep, Z = Zombie, R = Running etc.)
What’s innit 4 me? – pt 2 • % CPU – Percentage of CPU used • %MEM – Percentage of the RAM used • TIME+ - The Total Time of the activity of this PID • COMMAND – The COMMAND executing this PID
$>top
What’s innit 4 me? – pt 3
Quitting Top Easy – hit “q” anytime: $> q
Set the Refresh Rate Hit “d” or “s” anytime: The default is 3.0s $> d Or $> s
Set the Refresh rate - $>s or $>d
Sorting the output 1. Run TOP => $>top 2. Hit Shift-o (Uppercase O) => $>O
Sorting – Select a Column
Sorting – by CPU
Reversing the output Hit Shift – r (Uppercase r) $>R This will reverse the sort output.
Sorting – by CPU : Reversing -
Sorting – by CPU : Reversing -
See processing on ALL CPU’s Hit 1 $>1 This will display all CPU’s on the Node
See all CPU’s
Toggle with All CPU view... Hit 1again.... $>1 Switch to standard view.
Hide all CPU’s
Toggle with All CPU view... Hit 1again.... $>1 And when you get bored, Hit 1 again... And again... And again...
OOPS!!!
Highlight RUNNING processes... Hit b or z $>b Or $>z
Running processes: (b)
Running processes: (z) in Technicolor!!
To view SAS (and related) processes $> top – c sas
List SAS (and related) processes $> top – c sas
To view the FULL command path While TOP is running: Hit c $> c Toggle on and off by hitting c...
List SAS (and related) processes $> top – c sas
To watch a single user Hit top – u naughtyboy $> top – u naughtyboy
List PIDs by single user $> top – u username
To watch a single Process Hit top – p Process ID $> top – p 48311
List single PIDs $> top – p 48311
To kill a Process While top is running – Hit k $>k Prompt : PID to Kill: Type a PID: PID to Kill: 48311 Prompt : Kill PID 48311 with signal [15]? Type: y or n : y
Kill a single PIDs $> k Kill PID 23554 with signal [15]? y
You can save your top! • Run top • Set your preferred view ( >top – c sas) • Decide all CPUs or not (Hit 1) • Hit Uppercase w => $> W
To see all processes except ROOT • Check your TOP version => top – version • Requires Top version 3.2.9 and higher. • Hit top – u!root • $>top – u!root
To TOP or NOT to TOP Len van den Berg Questions and Answers?
Recommend
More recommend