From 3b226d19bb19a87eb565f3e1d16e14f446b56e76 Mon Sep 17 00:00:00 2001 From: johannst Date: Tue, 27 Aug 2024 22:25:00 +0000 Subject: deploy: 9b47b98b7c5efce0bf50d57aa5d7e374bcbabf23 --- monitor/index.html | 239 ------------------------------------------ monitor/lsof.html | 286 --------------------------------------------------- monitor/pgrep.html | 242 ------------------------------------------- monitor/pidstat.html | 253 --------------------------------------------- monitor/pmap.html | 238 ------------------------------------------ monitor/ps.html | 282 -------------------------------------------------- monitor/pstack.html | 234 ----------------------------------------- 7 files changed, 1774 deletions(-) delete mode 100644 monitor/index.html delete mode 100644 monitor/lsof.html delete mode 100644 monitor/pgrep.html delete mode 100644 monitor/pidstat.html delete mode 100644 monitor/pmap.html delete mode 100644 monitor/ps.html delete mode 100644 monitor/pstack.html (limited to 'monitor') diff --git a/monitor/index.html b/monitor/index.html deleted file mode 100644 index 577a377..0000000 --- a/monitor/index.html +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - Resource analysis & monitor - Notes - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - -
-
-

Resource analysis & monitor

- - -
- - -
-
- - - -
- - - - - - - - - - - - - - - - - - -
- - diff --git a/monitor/lsof.html b/monitor/lsof.html deleted file mode 100644 index 22ccfcc..0000000 --- a/monitor/lsof.html +++ /dev/null @@ -1,286 +0,0 @@ - - - - - - lsof - Notes - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - -
-
-

lsof(8)

-
lsof
-  -r <s> ..... repeatedly execute command ervery <s> seconds
-  -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
-  -s <p:s> ... in conjunction with '-i' filter for protocol <p> in state <s>
-  -U ......... show unix domain sockets ('@' indicates abstract sock name, see unix(7))
-
-
file flags:
-  R/W/RW ..... read/write/read-write
-  CR ......... create
-  AP ......... append
-  TR ......... truncate
-
-
-s protocols
-  TCP, UDP
-
--s states (TCP)
-  CLOSED, IDLE, BOUND, LISTEN, ESTABLISHED, SYN_SENT, SYN_RCDV, ESTABLISHED,
-  CLOSE_WAIT, FIN_WAIT1, CLOSING, LAST_ACK, FIN_WAIT_2, TIME_WAIT
-
--s states (UDP)
-  Unbound, Idle
-
-

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
-
-

Open connection to specific port

-

Show open connections to port :1234 for $USER:

-
lsof -a -u $USER -i :1234
-
-

IPv4 TCP connections in ESTABLISHED state

-
lsof -i 4TCP -s TCP:ESTABLISHED
-
-

List open files in a mounted directory.

-

This may help to find which processes keep devices busy when trying to unmount -and the device is currently busy.

-
# Assuming /proc is a mount point.
-lsof /proc
-
- -
- - -
-
- - - -
- - - - - - - - - - - - - - - - - - -
- - diff --git a/monitor/pgrep.html b/monitor/pgrep.html deleted file mode 100644 index 26403e4..0000000 --- a/monitor/pgrep.html +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - 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
-  -x         match exactly
-
-

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 deleted file mode 100644 index 2a317d2..0000000 --- a/monitor/pidstat.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - 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 deleted file mode 100644 index fb74c7a..0000000 --- a/monitor/pmap.html +++ /dev/null @@ -1,238 +0,0 @@ - - - - - - pmap - Notes - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - -
-
-

pmap(1)

-
pmap [opts] <pid>
-    Dump virtual memory map of process.
-    Compared to /proc/<pid>/maps it shows the size of the mappings.
-opts:
-  -p         show full path in the mapping
-  -x         show details (eg RSS usage of each segment)
-
- -
- - -
-
- - - -
- - - - - - - - - - - - - - - - - - -
- - diff --git a/monitor/ps.html b/monitor/ps.html deleted file mode 100644 index b8eb061..0000000 --- a/monitor/ps.html +++ /dev/null @@ -1,282 +0,0 @@ - - - - - - ps - Notes - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - -
-
-

ps(1)

-
ps [opt]
-  opt:
-    --no-header .... do not print column header
-    -o <OUT> ....... comma separated list of output columns
-    -p <PID> ....... only show pid
-    -C <name> ...... only show processes matching name
-    -T ............. list threads
-    --signames ..... use short signames instead bitmasks
-
-
-

Set PS_FORMAT env variable to setup default output columns.

-
-

Frequently used output columns

-
pid        process id
-ppid       parent process id
-pgid       process group id
-tid        thread id
-
-comm       name of process
-cmd        name of process + args (full)
-
-etime      elapsed time (since process started)
-user       user owning process
-thcount    thread count of process
-nice       nice value (-20 highest priority to 19 lowest)
-
-pcpu       cpu utilization (percent)
-pmem       physical resident set (rss) (percent)
-rss        physical memory (in kb)
-vsz        virtual memory (in kb)
-
-sig        mask of pending signals
-sigcatch   mask of caught signals
-sigignore  mask of ignored signals
-sigmask    mask of blocked signals
-
-

Example: Use output for scripting

-
for tid in $(ps -o tid --no-header -T -p 31084); do
-    taskset -c -p $tid;
-done
-
-

Example: Watch processes by name

-
watch -n1 ps -o pid,pcpu,pmem,rss,vsz,state,user,comm -C fish
-
-

Example: Show signal information

-
# With signal masks.
-ps -o pid,user,sig,sigcatch,sigignore,sigmask,comm -p 66570
-
-# With signal names.
-ps --signames -o pid,user,sig,sigcatch,sigignore,sigmask,comm -p 66570
-
- -
- - -
-
- - - -
- - - - - - - - - - - - - - - - - - -
- - diff --git a/monitor/pstack.html b/monitor/pstack.html deleted file mode 100644 index bfe9b77..0000000 --- a/monitor/pstack.html +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - pstack - Notes - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - -
-
-

pstack(1)

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