欢迎访问昆山宝鼎软件有限公司网站! 设为首页 | 网站地图 | XML | RSS订阅 | 宝鼎邮箱 | 宝鼎售后问题提交 | 后台管理


新闻资讯

MENU

软件开发知识

Linux 常用机 昆山软件定制开发 能阐明呼吁

点击: 次  来源:宝鼎软件 时间:2017-06-01

原文出处: waylau

机能阐明

vmstat

虚拟内存统计

用法

Usage:
 vmstat [options] [delay [count]]

Options:
 -a, --active           active/inactive memory
 -f, --forks            number of forks since boot
 -m, --slabs            slabinfo
 -n, --one-header       do not redisplay header
 -s, --stats            event counter statistics
 -d, --disk             disk statistics
 -D, --disk-sum         summarize disk statistics
 -p, --partition <dev>  partition specific statistics
 -S, --unit <char>      define display unit
 -w, --wide             wide output
 -t, --timestamp        show timestamp

 -h, --help     display this help and exit
 -V, --version  output version information and exit

示例

[root@localhost ~]# vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  0  71256  92720      0 565120    0    0     1   115   22   36  1  0 99  0  0

个中

  • r : 运行和期待 CPU 时间片的历程数。若该值大于系统 CPU 个数,软件开发,则说明 CPU 不敷
  • b : 暗示期待资源的历程数
  • swpd : 切换到内存互换区的内存巨细(单元 KB)
  • free: 空闲的物理内存的巨细,我的呆板内存总共2G,剩余92M。
  • buff: Linux/Unix系统是用来存储,目次内里有什么内容,权限等的缓存
  • cache:直接用来影象我们打开的文件,给文件做缓冲,把空闲的物理内存的一部门拿来做文件和目次的缓存,是为了提高 措施执行的机能,当措施利用内存时,buffer/cached会很快地被利用
  • si:每秒从磁盘读入虚拟内存的巨细,假如这个值大于0,暗示物理内存不足用可能内存泄露了,要查找耗内存历程办理掉。
  • so:每秒虚拟内存写入磁盘的巨细,假如这个值大于0,同上。
  • bi:块设备每秒吸收的块数量(读磁盘)(kb/s)
  • bo:块设备每秒发送的块数量(写磁盘)(kb/s)
  • in:每秒CPU的间断次数,包罗时间间断
  • cs:每秒上下文切换次数。
  • us:用户历程耗损 CPU 时间百分比
  • sy:内核历程耗损 CPU 时间百分比,sy 的值较高时,则说明内核耗损的 CPU 资源许多
  • id:空闲 CPU 时间百分比
  • wt:IO 期待 CPU 时间百分比
  • free

    内存利用状况

    [root@localhost ~]# free
                  total        used        free      shared  buff/cache   available
    Mem:        1849336     1193336       90344        1752      565656      460000
    Swap:       2097148       71248     2025900
    [root@localhost ~]# free -h
                  total        used        free      shared  buff/cache   available
    Mem:           1.8G        1.1G         88M        1.7M        552M        449M
    Swap:          2.0G         69M        1.9G
    [root@localhost ~]# free -m
                  total        used        free      shared  buff/cache   available
    Mem:           1805        1165          88           1         552         449
    Swap:          2047          69        1978
    [root@localhost ~]# free -h 2
                  total        used        free      shared  buff/cache   available
    Mem:           1.8G        1.1G         88M        1.7M        552M        449M
    Swap:          2.0G         69M        1.9G
    [root@localhost ~]# free -h -s 2
                  total        used        free      shared  buff/cache   available
    Mem:           1.8G        1.1G         88M        1.7M        552M        449M
    Swap:          2.0G         69M        1.9G
    
                  total        used        free      shared  buff/cache   available
    Mem:           1.8G        1.1G         88M        1.7M        552M        449M
    Swap:          2.0G         69M        1.9G
    
                  total        used        free      shared  buff/cache   available
    Mem:           1.8G        1.1G         88M        1.7M        552M        449M
    Swap:          2.0G         69M        1.9G

    uptime

    统计当前系统的运行环境

    [root@localhost ~]# uptime
     09:59:55 up 2 days, 7 min,  1 user,  load average: 0.00, 0.01, 0.05

    load average: 系统 1分钟,5分钟,15分钟的平均负荷

    netstat

    当前网络信息

    用法

    usage: netstat [-vWeenNcCF] [<Af>] -r         netstat {-V|--version|-h|--help}
           netstat [-vWnNcaeol] [<Socket> ...]
           netstat { [-vWeenNac] -I[<Iface>] | [-veenNac] -i | [-cnNe] -M | -s [-6tuw] } [delay]
    
            -r, --route              display routing table
            -I, --interfaces=<Iface> display interface table for <Iface>
            -i, --interfaces         display interface table
            -g, --groups             display multicast group memberships
            -s, --statistics         display networking statistics (like SNMP)
            -M, --masquerade         display masqueraded connections
    
            -v, --verbose            be verbose
            -W, --wide               don't truncate IP addresses
            -n, --numeric            don't resolve names
            --numeric-hosts          don't resolve host names
            --numeric-ports          don't resolve port names
            --numeric-users          don't resolve user names
            -N, --symbolic           resolve hardware names
            -e, --extend             display other/more information
            -p, --programs           display PID/Program name for sockets
            -o, --timers             display timers
            -c, --continuous         continuous listing
    
            -l, --listening          display listening server sockets
            -a, --all                display all sockets (default: connected)
            -F, --fib                display Forwarding Information Base (default)
            -C, --cache              display routing cache instead of FIB
            -Z, --context            display SELinux security context for sockets
    
      <Socket>={-t|--tcp} {-u|--udp} {-U|--udplite} {-w|--raw} {-x|--unix}
               --ax25 --ipx --netrom
      <AF>=Use '-6|-4' or '-A <af>' or '--<af>'; default: inet
      List of possible address families (which support routing):
        inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25)
        netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP)
        x25 (CCITT X.25)