Professional Documents
Culture Documents
trên Linux
Cơ bản đến nâng cao
Giới thiệu
Nguyễn Quốc Bảo
● Diễn ra liên tục trên số lượng lớn server, tốn ít tài nguyên
● Khó theo dõi được các sự kiện diễn ra tức thời.
Debug
● top
● htop
● ps
● …
top
htop
ps
Nhóm 2
Nhóm các tool để theo dõi Disk activity
● iotop
● nmon (có thể theo dõi nhiều tài nguyên khác như network, CPU,...)
● vmstat
● iostat, sar (không chạy interactive tốt, ít dùng)
iotop
Sắp xếp bằng phím mũi tên qua phải/trái. Bấm r để đảo thứ tự lớn/nhỏ.
nmon
vmstat
Nhóm 3
Nhóm các tool về network
● netstat
● tcpdump
● nload
● iftop
● Wireshark
Nhóm 4
Nhóm các tool về OS level
● strace
strace
strace
Nhóm 5
Theo dõi về các system call trong Linux
● Falco (https://falco.org/)
●
Falco rule
This rule uses the ioctl syscall to retrieve the
teaming interface settings, and checks if the LACP
protocol is enabled (the value 0x8809 is used to
represent the LACP protocol in the if_team.h
header file). If LACP is enabled, the rule generates
a warning message indicating the interface name.
● http://www.brendangregg.com/linuxperf.html
● https://github.com/brendangregg/FlameGraph
● https://github.com/iovisor/bcc
●
FlameChart
https://transfer.sh/wQ7Qo9/mongo1.svg
bcctool -
Track ZFS latency
Write too many data ?
Block size - Write
Nhóm 7
Intel PCM (https://github.com/intel/pcm)
● pcm-memory
● pcm-sensor-server
● pcm-pcie
● pcm-iio
Memory bandwidth
pcm-sensor-server
Lack of memory bandwidth lead to CPU cycle stall
Detect miner
Tài liệu tham khảo
● https://www.booleanworld.com/guide-linux-top-command/
● https://codeahoy.com/2017/01/20/hhtop-explained-visually/
● https://www.tecmint.com/ps-command-examples-for-linux-process-monitoring/
● https://www.baeldung.com/linux/monitor-disk-io
● https://www.howtogeek.com/424334/how-to-use-the-vmstat-command-on-linux/
● https://blog.packagecloud.io/monitoring-tuning-linux-networking-stack-receiving-data/
● https://www.site24x7.com/learn/linux/traffic-monitor.html
● https://www.thegeekstuff.com/2011/11/strace-examples/
● https://hackertarget.com/tcpdump-examples/
● https://falco.org/docs/getting-started/installation/
● https://www.youtube.com/watch?v=b1EDVH6BuBM
●
VietOpenInfra Meetup
● Thời gian: 8:30-11:30 AM, ngày
11/03/2023 (sáng thứ Bảy)
● Địa điểm: VNG Data Center, Lô S,
39-40 Đường số 19, Tân Thuận
Đông, Quận 7, Thành phố Hồ Chí
Minh
● Nội dung:
a. Session 1: Open Policy Agent:
Policy Controller for Kubernetes
and Microservices
b. Session 2: How to manage
public cloud infrastructure with
GitOps
c. Session 3: Distributed tracing
for microservices in OpenStack