1、查看物理CPU個數
[root@easfin bin]# cat /proc/cpuinfo |grep "physical id"|sort|uniq|wc -l
2
- [root@easfin bin]# cat /proc/cpuinfo |grep "physical id"|sort|uniq|wc -l
- 2
2、每個物理CPU中core的個數(即核數)
- [root@easfin bin]# cat /proc/cpuinfo |grep "cpu cores"|uniq
- cpu cores : 8
3、查看邏輯CPU的個數
- [root@easfin bin]# cat /proc/cpuinfo |grep "processor" |wc -l
- 32
按理說物理CPU個數×核數=邏輯CPU的個數,如果不等,說明服務器支持超線程技術。
4、查看硬盤及分區信息
- [root@easfin logs]# fdisk -l
- Disk /dev/sda: 299.4 GB, 299439751168 bytes
- 255 heads, 63 sectors/track, 36404 cylinders
- Units = cylinders of 16065 * 512 = 8225280 bytes
- Device Boot Start End Blocks Id System
- /dev/sda1 * 1 3916 31455238+ 83 Linux
- /dev/sda2 3917 8093 33551752+ 82 Linux swap / Solaris
- /dev/sda3 8094 36404 227408107+ 8e Linux LVM
5、查看硬盤空間使用情況
- [root@easfin logs]# df -h
- Filesystem Size Used Avail Use% Mounted on
- /dev/sda1 30G 22G 6.2G 78% /
- tmpfs 32G 0 32G 0% /dev/shm
- /dev/mapper/finance-fin
- 50G 39G 8.7G 82% /EAS70
- /dev/mapper/finance-easweb
- 50G 19G 29G 40% /EASweb
6、查看磁盤I/O性能
- [root@easfin logs]#iostat -x 1 1
- Linux 2.6.18-194.el5 (easfin) 12/07/2011
- avg-cpu: %user %nice %system %iowait %steal %idle
- 3.85 0.00 0.93 0.05 0.00 95.16
- Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util
- sda 0.03 32.97 0.09 6.57 8.45 316.35 48.80 0.32 48.40 3.02 2.01
- sda1 0.00 17.91 0.01 1.85 0.31 158.14 84.93 0.08 43.77 3.63 0.68
- sda2 0.00 0.00 0.00 0.00 0.00 0.00 43.07 0.00 18.44 17.73 0.00
- sda3 0.02 15.06 0.07 4.72 8.14 158.21 34.73 0.24 50.20 3.21 1.54
- dm-0 0.00 0.00 0.10 17.06 8.13 136.48 8.43 0.07 3.85 0.84 1.44
- dm-1 0.00 0.00 0.00 2.72 0.01 21.73 8.00 0.01 4.55 0.48 0.13
如果 %util接近100%,說明產生的I/O請求太多,I/O已經滿負荷,該磁盤可能存在瓶頸。
如果%idle小於70%,I/O的壓力就比較大了,說明讀取進程有較多的wait。同時還可以結合vmstat查看b參數(等待資源的進程數)和wa參數(I/O等待所佔用的CPU時間段百分比,
高過30%時I/O的壓力就比較高了)。
svctm應小於await
7、查看某個目錄的大小
- [root@easfin logs]# du -sh /EAS70/kingdee70
- 29G /EAS70/kingdee70
8、查看系統平均負載
- [root@easfin EAS70]# uptime
- 09:38:17 up 101 days, 21:05, 13 users, load average: 10.08, 9.69, 8.94
load average後面的值分別表示過去1分鐘、5分鐘、15分鐘內進程隊列中的平均進程數量!
- [root@easfin opt]# vmstat 2 5
- procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
- r b swpd free buff cache si so bi bo in cs us sy id wa st
- 6 0 344 219428 1031552 45554592 0 0 0 5 0 0 4 1 95 0 0
- 10 0 344 220048 1031552 45554740 0 0 0 2796 4923 23824 17 9 74 0 0
- 9 0 344 217632 1031552 45554692 0 0 0 2532 4787 21799 13 9 78 1 0
- 7 0 344 217024 1031552 45554736 0 0 0 1916 3780 25585 17 9 74 0 0
- 10 0 344 214644 1031552 45554832 0 0 0 32 3143 19736 15 9 76 0 0
》》如果每個CPU當前活動的進程數不大於3,表示系統性能良好,大於5,表示系統性能問題嚴重。
》》如果單個CPU的r大於3,並且id經常小於50,則表示CPU的負荷很重。
》》si、so長期不等於0,表示內存不足
【CPU核心數量=物理個數×核數,我這裏是2×8=16,r不大於48,系統CPU問題都不大】
9、查看系統內核
- [root@easfin /]# uname -a
- Linux easfin 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
10、查看系統是32位還是64位
- [root@easfin /]# 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
11、查看Linux發行版相關信息
- [root@easfin /]# 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: RedHatEnterpriseServer
- Description: Red Hat Enterprise Linux Server release 5.5 (Tikanga)
- Release: 5.5
- Codename: Tikanga
呵呵,先來11個,多了一下子記不住。。。