-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
248 lines (200 loc) · 9.17 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
"proc" is a colored top like utility which combines the features
of many other 'top'-like tools, but has more integrated features.
These include:
* History - you can scroll backwards to see the state of the system
at prior times.
* More commands.
* More detail on the commands.
* Ability to see absolute or relative counter values.
* Use of color.
Command Summary
---------------
abs Show absolute values.
agg Aggregate thread cpu into parent.
clear Clear counter values.
count Start counting mode.
cpu Show CPU details.
delay Set refresh delay.
delta Show delta values.
disk Show disk statistics..
files Show open file information
flush Flush open file from disk cache
graph Common graphs (loadavg, dirty memory, cached memory, etc)
grep Filter process output
help Display help
hide Hide a column
icmp Show IP/ICMP statistics
ifconfig Show network interface stats
ip Show IP/ICMP statistics
interrupts Show /proc/interrupts
log [on | off] Enable/disable logging
meminfo Memory info
netstat Show socket information
order [[-]nprstuc] Normal; Proc; RSS; Size; Time; User; CPU
proc Show specific proc
ps Display process mode
quit Exit from tool
range Show numbers in units/ranges
set Set options/limits.
show Show a hidden column
snap Dump snapshots to file to see history
softirqs Show /proc/softirqs
temp Show CPU temperatures
tcp Show TCP statistics
thread Toggle thread mode
udp Show UDP statistics
units Show units on numbers
vmstat Show vmstats
? Display help
! Run a unix command repeatedly
Ctrl-B - page/back; Ctrl-F - page/fwd; Ctrl-R - reset paging
Ctrl-L - redraw screen
When viewing the statistics screens, you may find it useful to
select "delta" mode if the statistics are monotonically increasing
counters. This makes it easier to spot which ones are changing and
how rapidly.
You can use the "clear" command to reset the onscreen counters to
make it easier to start a performance monitoring session or to just
watch, removing the noise from the history prior to the viewing session.
Header information
------------------
The header shows a number of fields, all incrementals from
the prior sample (typically 1s sample).
last pid: Shows the last pid created. If this is jumping in big
leaps then a fair amount of forking is going on. If
the new processes are not visible in the ps listing, then
it could be short lived processes (and %sys time
will likely be higher to handle the expense of processing
the forks/execs).
in: Interrupts. High levels of interrupts could be due to
I/O or network activity.
load avg: 1, 5 and 15 min load average.
Boot: Time when system last booted.
(Reverse) HH:MM:SS
When in rewind mode, the time of the sample (via
Ctrl-B/Ctrl-F)
HH:MM:SS Current time. Useful to watch in case no other activity.
CPU: Summary of the CPU characteristics (from /proc/cpuinfo)
If hyperthreading enabled, then "(HT)" will appear to
show the number of cores may be doubled up.
proc: Number of processes currently running or stopped or zombie.
thr: Number of threads.
RAM: Amount of memory in the system
RSS: Amount of resident working set for processes
Free: How much memory is free. Should be close to zero on a
normal system. Kernel will try and use memory for process
heaps or buffer cache. High free figure can indicate
large processes have terminated, or large files have
been deleted, or the memory hasnt been used since
bootup.
Dirty: How many dirty pages in memory which need to be committed to
disk. High figure indicates active I/O. Can be high when
doing large writes to slow devices (eg flash memory).
Swap: How much swap space is in use.
Free: How much swap space is available.
Absolute / Delta display mode
-----------------------------
Some commands simply show the pure data from /proc (eg meminfo and
vmstats). Many of these values are incrementing counters, and after a long
period of uptime, the number of digits is large enough that even
reading the numbers is hard work. Mentally determining what is
going on is equally difficult. For these reports, a delta is shown
next to the number to show if it is incrementing or decrementing
since the last display.
To make it easier to read, a historical graph of recent activity is
shown (typically around 2mins of history).
The counters can be set to show absolute values or delta values.
Delta values can be useful to show the count by 'zeroing' the value
and watching the values rise.
In addition the values can be displayed as pure numbers or as
K/M/G to indicate thousands, millions, billions.
The commands to use are:
* abs
* delta
* ranged
* clear
Detailed command summary
------------------------
Process information
Network information
disk Shows the details from /proc/diskstats. Graphs are shown
for each numeric field. It may be better to use the 'delta'
mode, otherwise you will only see big numbers incrementing.
CPU Shows the details from /proc/cpuinfo and the current MHz
speed of the cpu.
grep [!]expr Use this command to restrict the view to lines which match
or (!) do not match the patern. At present, the pattern
is a literal match (no regexp support). Prefix the pattern
with "!" to do a negative match. The expression is used
to match columns, rather than specific lines. Not all
views support the feature.
meminfo Show /proc/meminfo. Only non-zero values are displayed.
netstat Show current socket information. Additional details include
the owning process (if it can be determined). Given
that a socket can be shared amongst processes, only one
process is shown (use lsof utility or examine /proc/pid/fd
to find the duplicate owners).
The display is a multiline display. The first line shows
the owner of the socket, the rcv/snd data queue, connection
state and local/remote address, in numeric format. Subsequent
lines show the local/remote address as names. If the owning
process can be determined, then the PID and process name is shown.
If no pid/command line is shown, then we are not running as root
and cannot determine the owner.
You can use the "grep" command to restrict the view to
matching lines or non-matching lines. (Prefix grep
pattern with "!", e.g. "grep !LISTEN").
If the socket is new (less than about 20s), then the owner
is displayed in reverse video.
Open files / cache usage
proc <pid> Show details for a process, including /proc/pid/status,
/proc/pid/stack and /proc/pid/syscall.
softirqs Show /proc/softirqs. /proc/softirqs is used to indicate
deferred interrupt level processing (which is painful to
SMP configurations). Instead the interrupt routine is
deferred until it can be enabled whilst other interrupts
can be allowed. Its normal to see these on a well running
kernel. Higher numbers indicate more interrupt processing,
but also better perceived performance.
vmstat Show /proc/vmstat. There are lots of VM statistics and they
vary from kernel to kernel. The absolute value and a delta
from the prior value are shown, along with a graph showing
recent history. You can change the display mode to
abs/delta mode and reset the counters.
"proc" includes 20 minutes of buffered history - you can cycle
back in time, to take a closer look at something which gained
your attention.
Other commands
--------------
grep [<pattern>] Only show lines matching the pattern. Specify no
pattern to restore the full list.
History Mode
------------
Use the following keys to cycle through the history
<Ctrl-B> Move back 1s of time
<Ctrl-F> Move forward 1s of time
<Ctrl-R> Reset to 'realtime'
Whilst in history mode, the realtime clock at the top right of the
screen will adjust to the appropriate time sample.
Type 'help' whilst running to see the interactive commands available.
Environment Variables
---------------------
PROC_MAX_SYMS Number of shared memory symbol slots to reserve.
On later kernels, or kernels with lots of devices,
the default values may be too small, so you may want
to increase this, if "proc" complains of too few
values.
Default: 2048
PROC_MAX_TICKS Number of history slots to reserve per symbol. The
amount of memory is directly proportional to this
number. Each number corresponds to 1s of history.
(1024 is rougly 20mins and about 300+MB of memory).
Files
-----
"proc" uses shared memory to communicate between the collector/monitor.
You will see 'procmon' in the process table for the collector. Only
one process will run for the system - the collector is shared amongst
the proc clients.
Files are stored in /tmp/proc (or $TMPDIR/proc is $TMPDIR is
defined).
<img src="images/vm.png" />