2018.5.7 seven weeks Two lessons (monitor IO disk performance, free memory usage, ps,linux under grab packet)

Source: Internet
Author: User

Monitoring IO Disk Performance
命令如下:iostat -x 磁盘使用iotop 磁盘使用
    • %util look at the health of a hard drive,

    • Installing Iotop

      [[email protected] ~]# yum install -y iotop
    • Iotop command, mainly to see the io> column, see the performance of the disk

Free to view memory usage
概念:free命令可以查看当前系统的总内存大小以及使用内存的情况。字面意思:total 内存总大小;used 真正使用的实际内存大小;free 剩余物理内存大小(纯剩余);shared 共享内存大小,不用关注;buff/cache 分配给buffer和cache内存总共有多大;available free三个单位选项:-m 兆-g G-h 在具体在数字后加上单位
    磁盘的数据到CPU中间需要经过内存过程:    0000(内存) -- 内存(cache) -- CPU  #为了有一个缓和    CPU计算完了数据,需要转到磁盘,中间经过内存:    
    公式:    total=used+free+buff/cache    avalible包含free和buff/cache剩余部分
Free commands to view memory usage directly


Mem is the use of memory
Swap swap partition usage

PS Command Monitor system Status
 STAT部分说明: D 不能中断的进程  R run状态的进程 S sleep状态的进程 T 暂停的进程 Z 僵尸进程 < 高优先级进程 N 低优先级进程 L 内存中被锁了内存分页 s 主进程 l 多线程进程 + 前台进程
    • PS View system process, use PS aux and ps-elf, examples are as follows:

      [[email protected] ~]# ps auxUSER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMANDroot         1  0.0  0.6 128164  6824 ?        Ss   5月06   0:02 /usr/lib/systemd/systemd --switched-root --system --deserialize 21root         2  0.0  0.0      0     0 ?        S    5月06   0:00 [kthreadd]root         3  0.0  0.0      0     0 ?        S    5月06   0:00 [ksoftirqd/0].......
    • How to see if a process is running, as in the following example:
      [[Email protected] ~]# PS aux | grep nginx
      Root 44476 0.0 0.0 112676 984 pts/1 r+ 01:42 0:00 grep--color=auto nginx
Netstat Viewing network status
 netstat 查看网络状态 netstat -lnp 查看监听端口 netstat -an 查看系统的网络连接状况 netstat -lntp 只看出tcp的,不包含socket ss -an 和nestat异曲同工 分享一个小技巧: netstat -an | awk ‘/^tcp/ {++sta[$NF]} END {for(key in sta) print key,"\t",sta[key]}‘ #查看并发,有多少客户端在连接你
View Port NETSTAT-LNP
    l是监听的意思

Linux under Grab Bag tool tcpdump
    用法:    tcpdump -nn    tcpdump -nn -i ens33  #指定网卡查看    tcpdump -nn port 80  #指定端口查看    tcpdump -nn not port 22 and host 192.168.0.100 #指定非22端口的IP查看    tcpdump -nn -c 100 -w 1.cap #指定100个包 存到1.cap文件里去    tshark -n -t a -R http.request -T fields -e "frame.time" -e "ip.src" -e "http.host" -e "http.request.method" -e "http.request.uri"     yum install -y wireshark
Installing tcpdump
    [[email protected] ~]# yum install -y tcpdump
Tcpdump-nn, two nn, shown in digital form, second n represents the port number. Otherwise, the host name appears
    [[email protected] ~]# tcpdump -nn -i ens33 #-i 指定网卡
Specify port (ports) 80

2018.5.7 seven weeks Two lessons (monitor IO disk performance, free memory usage, ps,linux under grab packet)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.