linux 查看 CPU内存网络流量和磁盘 IO

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

使用vmstat命令来察看系统资源情况
在命令行方式下,如何查看CPU、内存的使用情况,网络流量和磁盘I/O?
Q: 在命令行方式下,如何查看CPU、内存的使用情况,网络流量和磁盘I/O?
A: 在命令行方式下,
1. 查看CPU使用情况的命令
""每5秒刷新一次,最右侧有CPU的占用率的数据
$ vmstat 5
""top 然后按Shift+P,按照进程处理器占用率排序
$ top
2. 查看内存使用情况的命令
""用free命令查看内存占用情况
$ free
""top 然后按Shift+M, 按照进程内存占用率排序
$ top
3. 查看网络流量
""可以用工具iptraf工具
$ iptraf -g
""针对某个Interface的网络流量可以通过比较两个时间网络接口的RX和TX数据来获得
$ date; ifconfig eth1
$ date; ifconfig eth1
4. 查看磁盘i/o
""用iostat查看磁盘/dev/sdc3的磁盘i/o情况,每两秒刷新一次
$ iostat -d -x /dev/sdc3 2
""用vmstat查看io部分的信息




Linux 查看CPU,内存,硬盘1 查看CPU


1.1 查看CPU个数
# cat /proc/cpuinfo | grep "physical id" | uniq | wc -l
2
**uniq命令:删除重复行;wc –l命令:统计行数**


1.2 查看CPU核数
# cat /proc/cpuinfo | grep "cpu cores" | uniq
cpu cores : 4


1.3 查看CPU型号
# cat /proc/cpuinfo | grep 'model name' |uniq
model name : Intel(R) Xeon(R) CPU E5630 @ 2.53GHz


总结:该服务器有2个4核CPU,型号Intel(R) Xeon(R) CPU E5630 @ 2.53GHz


2 查看内存


2.1 查看内存总数
#cat /proc/meminfo | grep MemTotal
MemTotal: 32941268 kB //内存32G


2.2 查看内存条数


本节内容引自新浪博文《Linux查看内存条数》
具体个数大小:dmidecode|grep -P -A5 "Memory\s+Device"|grep Size|grep -v Range
查看原文:


# dmidecode |grep -A16 "Memory Device$"
Memory Device
Array Handle: 0x1000
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 2048 MB //1条2G内存
Form Factor: DIMM
Set: 1
Locator: DIMM1
Bank Locator: Not Specified
Type: DDR2
Type Detail: Synchronous
Speed: 667 MHz
Manufacturer: 7F7F7F7F7F510000
Serial Number: 0403E324
Asset Tag: 450721
Part Number: 72T256220HR3SA
--
Memory Device
Array Handle: 0x1000
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 2048 MB //1条2G内存
Form Factor: DIMM
Set: 1
Locator: DIMM2
Bank Locator: Not Specified
Type: DDR2
Type Detail: Synchronous
Speed: 667 MHz
Manufacturer: 7F7F7F7F7F510000
Serial Number: 0403E324
Asset Tag: 450721
Part Number: 72T256220HR3SA
--
Memory Device
Array Handle: 0x1000

Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: No Module Installed //1个内存空槽
Form Factor: DIMM
Set: 2
Locator: DIMM3
Bank Locator: Not Specified
Type: DDR2
Type Detail: Synchronous
Speed: Unknown
Manufacturer:
Serial Number:
Asset Tag:
Part Number:
--
Memory Device
Array Handle: 0x1000
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: No Module Installed //1个内存空槽
Form Factor: DIMM
Set: 2
Locator: DIMM4
Bank Locator: Not Specified
Type: DDR2
Type Detail: Synchronous
Speed: Unknown
Manufacturer:
Serial Number:
Asset Tag:
Part Number:
--
Memory Device
Array Handle: 0x1000
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: No Module Installed //1个内存空槽
Form Factor: DIMM
Set: 3
Locator: DIMM5
Bank Locator: Not Specified
Type: DDR2
Type Detail: Synchronous
Speed: Unknown
Manufacturer:
Serial Number:
Asset Tag:
Part Number:
--
Memory Device
Array Handle: 0x1000
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: No Module Installed //1个内存空槽
Form Factor: DIMM
Set: 3
Locator: DIMM6
Bank Locator: Not Specified
Type: DDR2
Type Detail: Synchronous
Speed: Unknown
Manufacturer:
Serial Number:
Asset Tag:
Part Number:



总结:该服务器有两条2G内存 ,空余4个插槽


3 查看硬盘


3.1 查看硬盘大小
# fdisk -l | grep Disk
Disk /dev/cciss/c0d0: 146.7 GB, 146778685440 bytes
总结:硬盘大小146.7G,即厂商标称的160G




相关文档
最新文档