Measurement - shuwens/NetBricks GitHub Wiki
- Instrumentation and measurement
- CPU and memory
- Using eBPF to measure disk io and network latency
- Measuring elapsed time
CPU/mem measure again
1
pidstat -u 1 10 | grep ^Average | sort -r -n -b -k 8,8
top -b -n 2 -d 0.2 -p 6962 | tail -1 | awk '{print $9}'
2
https://unix.stackexchange.com/questions/288589/get-chromes-total-memory-usage
detailed output, in kB apparently
smem -t -P chrom
just the total PSS, with automatic unit:
smem -t -k -c pss -P chrom | tail -n 1
3
4
https://askubuntu.com/questions/56266/how-to-log-memory-and-cpu-usage-of-an-application
top -b -d 10 -n 3 >> top-file
5
6: sum ps mem
7
https://unix.stackexchange.com/questions/13968/show-top-five-cpu-consuming-processes-with-ps
8
top -b -n 2 -d 0.2 -p 6962 | tail -1 | awk '{print $9}'
9
https://phoenixnap.com/kb/check-cpu-usage-load-linux
10
https://www.cyberciti.biz/tips/how-do-i-find-out-linux-cpu-utilization.html
11
https://linoxide.com/monitoring-2/10-tools-monitor-cpu-performance-usage-linux-command-line/
Instrumentation and measurement
ps 2: figure out how to calculate child process together
https://stackoverflow.com/questions/38341366/how-to-specify-commandline-arguments-in-pgrep-in-bash
https://stackoverflow.com/questions/29879057/pgrep-command-not-returning-pid
https://linuxize.com/post/pgrep-command-in-linux/
https://unix.stackexchange.com/questions/74185/how-can-i-prevent-grep-from-showing-up-in-ps-results
https://unix.stackexchange.com/questions/428035/linux-use-pgrep-command
https://unix.stackexchange.com/questions/285147/do-not-produce-output-when-process-does-not-exist
https://unix.stackexchange.com/questions/267007/pgrep-full-match-not-work-only-part-why
https://serverfault.com/questions/77162/how-to-get-pgrep-to-display-full-process-info/210823
https://www.howtogeek.com/448271/how-to-use-the-ps-command-to-monitor-linux-processes/
https://www.tecmint.com/ps-command-examples-for-linux-process-monitoring/
https://www.linuxtechi.com/ps-command-examples-monitor-linux-processes/
https://stackoverflow.com/questions/938733/total-memory-used-by-python-process
https://unix.stackexchange.com/questions/20483/how-to-find-which-process-is-causing-high-cpu-usage
https://unix.stackexchange.com/questions/554/how-to-monitor-cpu-memory-usage-of-a-single-process
top
https://askubuntu.com/questions/56266/how-to-log-memory-and-cpu-usage-of-an-application
https://askubuntu.com/questions/923922/how-to-save-cpu-logs-or-gpu-usage-values
htop
else
https://askubuntu.com/questions/726333/how-to-save-htop-output-to-file
https://askubuntu.com/questions/726333/how-to-save-htop-output-to-file
https://coderwall.com/p/ej7bqq/log-memory-usage-per-second-or-minute-on-linux
CPU and memory
https://linuxhint.com/check_memory_usage_process_linux/
https://alvinalexander.com/linux/unix-linux-process-memory-sort-ps-command-cpu
https://virtualthreads.blogspot.com/2006/02/understanding-memory-usage-on-linux.html
https://stackoverflow.com/questions/22261452/finding-memory-usage-of-a-process-in-linux
https://stackoverflow.com/questions/4802481/how-to-see-top-processes-sorted-by-actual-memory-usage
https://stackoverflow.com/questions/774556/peak-memory-usage-of-a-linux-unix-process
https://www.geeksforgeeks.org/tracing-memory-usage-linux/
https://www.binarytides.com/linux-command-check-memory-usage/
https://unix.stackexchange.com/questions/164653/actual-memory-usage-of-a-process
https://unix.stackexchange.com/questions/554/how-to-monitor-cpu-memory-usage-of-a-single-process
https://unix.stackexchange.com/questions/166558/how-to-check-which-process-is-using-most-memory
https://unix.stackexchange.com/questions/334232/memory-consumption-of-process
https://www.golinuxcloud.com/check-memory-usage-per-process-linux/
https://www.linux.com/tutorials/5-commands-checking-memory-usage-linux/
https://www.tecmint.com/find-linux-processes-memory-ram-cpu-usage/
http://www.brendangregg.com/FlameGraphs/memoryflamegraphs.html
https://www.circonus.com/2018/05/linux-system-monitoring-with-ebpf/
https://jvns.ca/blog/2018/01/31/spying-on-a-ruby-process-s-memory-allocations/
https://sematext.com/blog/linux-kernel-observability-ebpf/
for measuring latency
m-better-w-groupby
pkt count 1100
# of start ts: 12791, # of stop ts: 1000
start to reset: avg processing time is 3.562315ms
Pkt counters
1
1
pkt counter 1: 12791
pkt counter 2: 0
pkt counter 6: 1000
30.01 OVERALL RX 3413135.87 TX 3412570.66
m-verify-order-1
m-verify-order-1-w-pc
After meta: Measurement started
NUM_TO_IGNORE: 10000000, pkt_count: 10000000
After tcph Measurement started
NUM_TO_IGNORE: 10000000, pkt_count: 10000000
Actual processing Measurement started
NUM_TO_IGNORE: 10000000, pkt_count: 10000000
pkt count 11000000
# of start ts: 1000019, # of stop ts: 999999
start to transform after meta: avg processing time is 1.461µs
pkt count 11000000
# of start ts: 1000019, # of stop ts: 999999
start t0 after tcph: avg processing time is 2.79µs
pkt count 11000000
# of start ts: 1000019, # of stop ts: 999999
start to after actural processing: avg processing time is 7.48µs
Pkt counters
pkt counter 1: 1001824
pkt counter 2: 1001824
pkt counter 3: 1000019
pkt counter 4: 1000019
pkt counter 5: 1000019
pkt counter 6: 1000000
m-verify-order-2
m-verify-order-excessive
Using eBPF to measure disk io and network latency
Disk
tools/biotop: Top for disks: Summarize block device I/O by process. Examples.
Network IO
tools/tcptop: Summarize TCP send/recv throughput by host. Top for TCP. Examples.
tools/tcpdrop: Trace kernel-based TCP packet drops with details. Examples.
tools/tcplife: Trace TCP sessions and summarize lifespan. Examples.
tools/tcpstates: Trace TCP session state changes with durations. Examples.
tools/tcpsubnet: Summarize and aggregate TCP send by subnet. Examples.
tools/tcptracer: Trace TCP established connections (connect(), accept(), close()). Examples.
new (udp)
https://www.unixmen.com/iptraf-tcpudp-network-monitoring-utility/
https://www.tecmint.com/watch-tcp-and-udp-ports-in-linux/
https://www.tecmint.com/20-netstat-commands-for-linux-network-management/
https://askubuntu.com/questions/257263/how-to-display-network-traffic-in-the-terminal
https://askubuntu.com/questions/333921/list-all-internet-connections
https://blog.packagecloud.io/eng/2017/02/06/monitoring-tuning-linux-networking-stack-sending-data/
https://www.cyberciti.biz/tips/linux-investigate-sockets-network-connections.html
https://linuxhint.com/send_receive_udp_packets_linux_cli/
net io
iftop
nethogs
iptraf-ng
https://www.slashroot.in/linux-iptraf-and-iftop-monitor-and-analyse-network-traffic-and-bandwidth
sar: https://askubuntu.com/questions/257263/how-to-display-network-traffic-in-the-terminal
ifstat
iftop
glances
slurm
nettop: https://askubuntu.com/questions/333921/list-all-internet-connections
qperf: https://www.opsdash.com/blog/network-performance-linux.html
https://opensourceforu.com/2016/10/network-performance-monitoring/
Measuring elapsed time
https://docs.rs/chrono/0.4.9/chrono/
https://doc.rust-lang.org/beta/std/time/struct.Instant.html
https://docs.rs/time/0.1.42/time/
iptraf-ng
https://github.com/ramlohith/NOCManager/blob/b2fef82812fe54b3b7c88c69c9f3e229b2055d16/testing.sh
https://github.com/subhshetty/iptraf-ng/blob/2aebc41b53e87edf1ec5704dedd1e3606a00ee8d/iptraf-ng.sh
https://github.com/usui-tk/amazon-ec2-userdata
https://github.com/maravento/gateproxy/blob/8ec1f839517b651c11a63c325c0ac572be81fa83/gateproxy.sh