Linux常用性能检测命令解释

本文发布时间: 2019-Mar-22
1、uptime[[email protected] ~]# uptime 15:08:15 up 98 days, 4:19, 2 users, load average: 0.07, 0.29, 0.14当前时间 系统运行至今的时间 多少用户登录当前系统 分别是1分钟,5分钟,15分钟前至今的负载情况load average是队列平均长度,在队列中等待执行的进程数量该值越低,说明进程更有可能立即被CPU处理,相反越高,说明进程更有可能阻塞该命令可以检查服务器负载是否高。2、top显示CPU实际使用情况QTogv8nWtNDQtPrC69LUzeK1xLK/t9ajqMr9vt22ziYjNDM71bujqdW808O1xM7vwO3E2rTmtPPQoaOoa2KjqTwvcD4KPHA+CiBuRkxUINKzw+a07c7ztM7K/TwvcD4KPHA+CiBuRFJUINfuuvPSu7TO0LTI67W9z9bU2qOssbvQ3rjEuf21xNKzw+bK/aGjPC9wPgo8cD4KIFNUQVSjur34s8y1xNe0zKyjulOjvdDdw9/XtMyso6xSo73Uy9DQ17TMrKOsVKO9zaPWude0zKyjrESjvdbQts/Q3cPf17TMrKOsWqO9vanKrNe0zKw8L3A+CjxwPgogV0NIQU4gyPS4w734s8zU2suvw9+jrNTyz9TKvsuvw9/W0LXEz7XNs7qvyv3D+zwvcD4KPHA+CiBGbGFncyDIzs7xserWvqOsss6/vCBzY2hlZC5oPC9wPgoKIFNJWkWjur34s8zVvNPDtcTE2rTmyv3Bv6OotPrC66Oryv2+3aOrttHVu6OpPGJyPgogUlNTo7u9+LPMyrnTw7XEzu/A7cTatObK/cG/PGJyPgogQmFkbmVzcz1vb21fc2NvcmUoYmFuZG5lc3MpCgogQWRqPW9vbV9hZGp1c3RtZW50CsrkyOvN6nRvcMP8we6686Osv8m8zND4sLTPwma8/KOs0aHU8dDo0qrM7bzTtcTP1Mq+wdAKPHA+PC9wPgo8cD4Kzai5/SBmILz8v8nS1NGh1PHP1Mq+tcTE2sjdoaOwtCBmILz81q6687vhz9TKvsHQtcTB0LHto6ywtCBhLXogvLS/yc/Uyr678tL+sti21NOmtcTB0KOs1+6687C0u9iztbz8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kwO+jrNXiuPa9+LPMtcTXtMyszqq9qcqs17TMrKGj1Nq9+LPMzeqzycv509C52LHVyM7O8dauuvOjrLvhz/K4uL34s8zM4b27y/y52LHVtcTQxc+ioaPT0NCpx+m/9s/Co6zSu7j2vanKrL34s8yyu8Tcudix1cv819S8uqOs1eLKsdXiuPa9+LPM17TMrL7Nzqp6o6h6b21iaWWjqaGjsrvE3Mq508NraWxsw/zB7smxy8C9qcqsvfizzKOs0vLOqsv80tG+rbHq1r7OqqGwZGVhZKGxoaPI57n7xOPO3reosNrN0dK7uPa9qcqsvfizzKOsxOO/ydLUybHLwMv8tcS4uL34s8yjrNXiuPa9qcqsvfizzNKyvs3P+8qnwcuho8i7tvijrMjnufu4uL34s8zKx2luaXS9+LPMo6zE47K7xNzJscvAaW5pdL34s8yjrNLyzqppbml0ysfSu7j21tjSqrXEz7XNs734s8yjrNXi1tbH6b/2z8LE49a7xNzNqLn90ru0ztbY0MLG9Lavt/7O8cb3wLSw2s3RvanKrL34s8yho9KysdjQ67fWzvbTptPDzqrKssO0u+G1vNbCvanLwKO/PGJyPgo8cD612rb+0NB0YXNrc7/J0tS/tLW9z7XNs9bQvanKrL34s8y1xMr9wb88L3A+CjxwPjxzdHJvbmc+M6GiaW9zdGF0PC9zdHJvbmc+PC9wPgo8cD48aW1nIHNyYz0="http:///uploadfile/files/2014/0804/20140804180315699.png" alt="">avg-cpu:%user:user level(应用)的CPU占用率情况%nice:加入nice优先级的user level的CPU占用率情况%sys:system level(内核)的CPU占用情况%idle:空闲的CPU资源情况磁盘信息Device:块设备名Tps:设备每秒进行传输的数量(每秒的I/O请求)。多个单独的I/O请求可以被组成一个传输操作,因为一个传输操作可以是不同的容量。Blk_read/s, Blk_wrtn/s:该设备每秒读写的块的数量。块可能为不同的容量。Blk_read, Blk_wrtn:自系统启动以来读写的块设备的总量。4、vmstat Vmstat命令提供了对进程、内存、页面I/O块和CPU等信息的监控,vmstat可以显示检测结果的平均值或者取样值,取样模式可以提供一个取样时间段内不同频率的监测结果·process(procs)r:等待运行时间的进程数量b:处在不可中断睡眠状态的进程w:被交换出去但是仍然可以运行的进程,这个值是计算出来的·memoryswpd:虚拟内存的数量free:空闲内存的数量buff:用做缓冲区的内存数量·swapsi:从硬盘交换来的数量so:交换到硬盘去的数量·IObi:向一个块设备输出的块数量bo:从一个块设备接受的块数量·systemin:每秒发生的中断数量, 包括时钟cs:每秒发生的context switches的数量·cpu(整个cpu运行时间的百分比)us:非内核代码运行的时间(用户时间,包括nice时间)sy:内核代码运行的时间(系统时间)id:空闲时间wa:等待I/O操作的时间·m:显示内核的内存利用率·a:显示内存页面信息,包括活跃和不活跃的内存页面·n:显示报头行,这个参数在使用取样模式并将命令结果输出到一个文件时非常有用。例如root#vmstat –n 2 10以2秒的频率显示10输出结果5、ps和pstree分析进程的好命令啊!6、sar自动收集保存系统信息,crontab配置系统定时任务crontab命令格式含义:分钟(0-59) 小时(0-23) 日期(1-31) 月份(1-12) 星期(0-6) 命令段下面看看看几个具体的例子:● 0 */2 * * * /sbin/service httpd restart 意思是每两个小时重启一次apache ● 50 7 * * * /sbin/service sshd start 意思是每天7:50开启ssh服务 ● 50 22 * * * /sbin/service sshd stop 意思是每天22:50关闭ssh服务 ● 0 0 1,15 * * fsck /home 每月1号和15号检查/home 磁盘 ● 1 * * * * /home/bruce/backup 每小时的第一分执行 /home/bruce/backup这个文件 ● 00 03 * * 1-5 find /home "*.xxx" -mtime +4 -exec rm {} \; 每周一至周五3点钟,在目录/home中,查找文件名为*.xxx的文件,并删除4天前的文件。● 30 6 */10 * * ls 意思是每月的1、11、21、31日是的6:30执行一次ls命令 7、free显示系统内存信息·-b,-k,-m和-g分别按照bytes, kilobytes, megabytes, gigabytes显示结果。·-l区别显示low和high内存·-c {count}显示free输出的次数8、pmappmap pid查看具体进程的内存使用情况


(以上内容不代表本站观点。)
---------------------------------
本网站以及域名有仲裁协议。
本網站以及域名有仲裁協議。

2019-May-25 12:57pm
栏目列表