詳解Linux服務(wù)器狀態(tài)、性能相關(guān)命令

發(fā)布時間:2024-02-11
服務(wù)器
服務(wù)器狀態(tài)分析
查看linux服務(wù)器cpu詳細情況
#查看cpu的信息
[root@host ~]# cat /proc/cpuinfo
#查看物理cpu的個數(shù)
[root@host /]# cat /proc/cpuinfo | grep physical id | sort | uniq | wc -l
#查看每個物理cpu的核數(shù)
[root@host /]# cat /proc/cpuinfo | grep cpu cores | uniq
#邏輯cpu的個數(shù)(邏輯cpu = 物理cpu個數(shù)*核數(shù))
[root@host /]# cat /proc/cpuinfo | grep processor | wc -l
查看linux服務(wù)器內(nèi)存情況
#查看內(nèi)存使用情況
[root@host ~]# free -m total used free shared buffers cached mem: 372 256 115 0 17 158 -/ buffers/cache: 81 290 swap: 509 0 509
>total:內(nèi)存總數(shù)
>user:已使用內(nèi)存數(shù)
>free:空閑內(nèi)存數(shù)
>shared:多進程共享內(nèi)存數(shù)
>buffers:緩沖內(nèi)存數(shù)
>cached:緩存內(nèi)存數(shù)
可用內(nèi)存 = free buffers cached
已用內(nèi)存 = used-buffers-cached
swap 交換內(nèi)存數(shù),此項可判斷內(nèi)存是否夠用的標(biāo)準(zhǔn)
查看linux服務(wù)器硬盤使用情況
#查看硬盤及分區(qū)信息
fdisk -l
[root@host ~]# fdisk -l disk /dev/sda: 10.7 gb, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders units = cylinders of 16065 * 512 = 8225280 bytes device boot start end blocks id system /dev/sda1 * 1 13 104391 83 linux /dev/sda2 14 78 522112 82 linux swap / solaris /dev/sda3 79 1305 9855877 83 linux #檢查文件系統(tǒng)的磁盤空間占用情況df -h
[root@host ~]# df -h filesystem size used avail use% mounted on /dev/sda3 9.2g 6.4g 2.3g 74% / /dev/sda1 99m 12m 82m 13% /boot tmpfs 187m 0 187m 0% /dev/shm /dev/hdc 4.1g 4.1g 0 100% /mnt
服務(wù)器性能分析
#查看硬盤的i/o性能
[root@host /]# iostat -d -x -k 1 5
#iostaat是含在套裝systat中,在centos5.5用命令yum -y install sysstat來安裝
i/0
查看linux服務(wù)器的平均負載
[root@host /]# uptime 12:39:12 up 2:50, 3 users, load average: 0.00, 0.03, 0.00
[root@host /]# w 12:39:59 up 2:50, 3 users, load average: 0.00, 0.03, 0.00 user tty from login@ idle jcpu pcpu what root tty1 - 09:53 32:17 0.36s 0.36s -bash root pts/0 192.168.1.102 10:23 1:54m 0.03s 0.03s -bash root pts/1 192.168.1.105 12:16 0.00s 0.09s 0.02s w 監(jiān)控linux服務(wù)器的整體性能
整體性能
[root@host /]# vmstat 1 4 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 0 50464 50096 101356 0 0 21 13 925 183 0 0 99 1 0 0 0 0 50464 50096 101380 0 0 0 0 830 18 0 0 100 0 0 0 0 0 50464 50096 101380 0 0 0 0 833 27 0 0 100 0 0 0 0 0 50464 50104 101372 0 0 0 32 822 27 0 0 99 1 0 #proces r:等待運行的進程數(shù) b:非中斷睡眠狀態(tài)的進程數(shù) w:被交換出去的可運行進程數(shù)
#memory swpd:虛擬內(nèi)存使用情況 fres:空閑的內(nèi)存 buff:用作緩存的內(nèi)存數(shù)(單位:kb)
#swap si:從磁盤交換到內(nèi)存的交換頁數(shù)量 so:從內(nèi)存交換到磁盤的交換頁數(shù)量(單位:kb/秒)
#io bi:發(fā)送到塊設(shè)備的塊數(shù) bo:從塊設(shè)備接收到的塊數(shù)(單位:塊/秒)
#system in:每秒的中斷數(shù),包括時鐘中斷 cs:每秒的環(huán)境(上下文)切換數(shù)
#cpu us:cpu使用時間 sy:cpu系統(tǒng)使用時間 id:閑置時間(單位:百分比)
標(biāo)準(zhǔn)情況下:r小于5,b約為0
如果user sys 小于70 表示系統(tǒng)性能較好;如果大于等于85以上,表示性能比較糟糕
查看linux服務(wù)器的其他參數(shù)
查看系統(tǒng)內(nèi)核的版本號
[root@host /]# uname -a linux host.domain.com 2.6.18-194.el5 #1 smp fri apr 2 14:58:14 edt 2010 x86_64 x86_64 x86_64 gnu/linux [root@host /]# uname -r 2.6.18-194.el5 查看系統(tǒng)32位還是64位
[root@host /]# ls -1f / |grep /$
查找是否有/lib64,有則系統(tǒng)為64位
另一種查看系統(tǒng)32位還是64位
[root@host /]# file /sbin/init /sbin/init: elf 64-bit lsb executable, amd x86-64, version 1 (sysv), for gnu/linux 2.6.9, dynamically linked (uses shared libs), for gnu/linux 2.6.9, stripped 查看服務(wù)器使用的linux發(fā)行版的相關(guān)信息
[root@host /]# lsb_release -a lsb version: :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch distributor id: centos description: centos release 5.5 (final) release: 5.5 codename: final 查看系統(tǒng)已載入的相關(guān)模塊
[root@host /]# lsmod |grep ip ipv6 435361 24 xfrm_nalgo 43333 1 ipv6 dm_multipath 56920 0 scsi_dh 42177 1 dm_multipath dm_mod 101649 4 dm_mirror,dm_multipath,dm_raid45,dm_log 在linux下查看pci設(shè)置,lspci命令能列出機器中的pci信息,比如聲卡、顯卡、modem
[root@host /]# lspci | grep ether 02:01.0 ethernet controller: intel corporation 82545em gigabit ethernet controller (copper) (rev 01) 總結(jié)
以上所述是小編給大家介紹的linux服務(wù)器狀態(tài)、性能相關(guān)命令,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對西部數(shù)碼網(wǎng)站的支持!
上一個:PCR操作時應(yīng)注意的事項
下一個:用戶名網(wǎng)站怎么突然打不開

華為電腦黑屏無法喚醒屏幕是質(zhì)量問題嗎(華為電腦黑屏沒反應(yīng))
廣聯(lián)達圖形算量軟件學(xué)習(xí)心得
唐山遷西今年過年流行送鮮花
紅米手機前面怎么沒標(biāo)志,紅米手機桌面圖標(biāo)不見了怎么辦
物聯(lián)網(wǎng)待起飛 建立合適的生態(tài)系統(tǒng)是關(guān)鍵
男方陪產(chǎn)假工資怎么發(fā)
從君子蘭外觀察病害
TAJA156K016RNJ鉭電容現(xiàn)貨查詢,價格查詢
免費恢復(fù)相冊照片,恢復(fù)相冊里面的照片免費
功率標(biāo)準(zhǔn)源的技術(shù)參數(shù)
十八禁 网站在线观看免费视频_2020av天堂网_一 级 黄 色 片免费网站_绝顶高潮合集Videos