From 15230bbb9b1f69def9b0e1b41a097638c0fda734 Mon Sep 17 00:00:00 2001 From: johannst Date: Tue, 28 Apr 2020 09:11:18 +0000 Subject: deploy: fef4d6ff2ad9f48e6dccde0f061453e6a3ac624e --- monitor/index.html | 220 +++++++++++++++++++++++++++++++++++++++++++++ monitor/lsof.html | 249 +++++++++++++++++++++++++++++++++++++++++++++++++++ monitor/pgrep.html | 230 +++++++++++++++++++++++++++++++++++++++++++++++ monitor/pidstat.html | 242 +++++++++++++++++++++++++++++++++++++++++++++++++ monitor/pmap.html | 224 +++++++++++++++++++++++++++++++++++++++++++++ monitor/pstack.html | 223 +++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 1388 insertions(+) create mode 100644 monitor/index.html create mode 100644 monitor/lsof.html create mode 100644 monitor/pgrep.html create mode 100644 monitor/pidstat.html create mode 100644 monitor/pmap.html create mode 100644 monitor/pstack.html (limited to 'monitor') diff --git a/monitor/index.html b/monitor/index.html new file mode 100644 index 0000000..3c31883 --- /dev/null +++ b/monitor/index.html @@ -0,0 +1,220 @@ + + + + + + Resource analysis & monitor - Notes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + +
+
+

Resource analysis & monitor

+ +
+ + +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/monitor/lsof.html b/monitor/lsof.html new file mode 100644 index 0000000..51c8327 --- /dev/null +++ b/monitor/lsof.html @@ -0,0 +1,249 @@ + + + + + + lsof - Notes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + +
+
+

lsof(8)

+
lsof
+  -a ......... AND slection filters instead ORing (OR: default)
+  -p <pid> ... filter by <pid>
+  +fg ........ show file flags for file descripros
+  -n ......... don't convert network addr to hostnames
+  -P ......... don't convert network port to service names
+  -i <@h[:p]>. show connections to h (hostname|ip addr) with optional port p
+
+
file flags:
+  R/W/RW ..... read/write/read-write
+  CR ......... create
+  AP ......... append
+  TR ......... truncate
+
+

Examples

+

File flags

+

Show open files with file flags for process:

+
lsof +fg -p <pid>
+
+

Open TCP connections

+

Show open tcp connections for $USER:

+
lsof -a -u $USER -i tcp
+
+

Note: -a ands the results. If -a is not given all open files matching +$USER and all tcp connections are listed (ored).

+

Open connection to specific host

+

Show open connections to localhost for $USER:

+
lsof -a -u $USER -i @localhost
+
+ +
+ + +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/monitor/pgrep.html b/monitor/pgrep.html new file mode 100644 index 0000000..888690d --- /dev/null +++ b/monitor/pgrep.html @@ -0,0 +1,230 @@ + + + + + + pgrep - Notes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + +
+
+

pgrep(1)

+
pgrep [opts] <pattern>
+  -n         only list newest matching process
+  -u <usr>   only show matching for user <usr>
+  -l         additionally list command
+  -a         additionally list command + arguments
+
+

Debug newest process

+

For example attach gdb to newest zsh process from $USER.

+
gdb -p $(pgrep -n -u $USER zsh)
+
+ +
+ + +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/monitor/pidstat.html b/monitor/pidstat.html new file mode 100644 index 0000000..c451072 --- /dev/null +++ b/monitor/pidstat.html @@ -0,0 +1,242 @@ + + + + + + pidstat - Notes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + +
+
+

pidstat(1)

+
pidstat [opt] [interval] [cont]
+  -U [user]     show username instead UID, optionally only show for user
+  -r            memory statistics
+  -d            I/O statistics
+  -h            single line per process and no lines with average
+
+

Page fault and memory utilization

+
pidstat -r -p <pid> [interval] [count]
+
+
minor_pagefault: Happens when the page needed is already in memory but not
+                 allocated to the faulting process, in that case the kernel
+                 only has to create a new page-table entry pointing to the
+                 shared physical page (not required to load a memory page from
+                 disk).
+
+major_pagefault: Happens when the page needed is NOT in memory, the kernel
+                 has to create a new page-table entry and populate the
+                 physical page (required to load a memory page from disk).
+
+

I/O statistics

+
pidstat -d -p <pid> [interval] [count]
+
+ +
+ + +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/monitor/pmap.html b/monitor/pmap.html new file mode 100644 index 0000000..9e37c1e --- /dev/null +++ b/monitor/pmap.html @@ -0,0 +1,224 @@ + + + + + + pmap - Notes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + +
+
+

pmap(1)

+
pmap <pid>
+    Dump virtual memory map of process.
+    Compared to /proc/<pid>/maps it shows the size of the mappings.
+
+ +
+ + +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/monitor/pstack.html b/monitor/pstack.html new file mode 100644 index 0000000..2458a7c --- /dev/null +++ b/monitor/pstack.html @@ -0,0 +1,223 @@ + + + + + + pstack - Notes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + +
+
+

pstack(1)

+
pstack <pid>
+    Dump stack for all threads of process.
+
+ +
+ + +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3