From: http://blogread.cn/it/article.php? Id = 3908 & F = sinatiostat view disk I/O
[root@localhost ~]# iostat -d -x 2 extended device statisticsdevice mgr/s mgw/s r/s w/s kr/s kw/s size queue wait svc_t %bhda 0 0 0.0 0.9 0.1 5.4 6.3 0.0 4.7 0.9 0 extended device statisticsdevice mgr/s mgw/s r/s w/s kr/s kw/s size queue wait svc_t %bhda 0 3 0.0 2.0 0.0 20.0 10.0 0.0 0.8 0.5 0 ......
Command Description: view disk I/0, and refresh every two seconds
[Root @ localhost ~] # Vmstat 5 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 284 165876 416748 0 0 0 5 1 1 0 0 0 0 0 ......
Command Description: Command Used to view CPU usage, which is refreshed every 5 seconds. the rightmost column is the CPU usage data.
Top view process shares
[root@localhost ~]# top
Then, Enter Shift + P or P in the command bar of the top command.
top - 13:38:52 up 102 days, 4:17, 1 user, load average: 0.00, 0.00, 0.00Tasks: 81 total, 2 running, 79 sleeping, 0 stopped, 0 zombieCpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%stMem: 1035292k total, 966592k used, 68700k free, 165876k buffersSwap: 2096472k total, 284k used, 2096188k free, 416760k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 4875 root 15 0 2192 1000 800 R 0.3 0.1 0:00.15 top 1 root 15 0 2060 620 532 S 0.0 0.1 0:01.65 init 2 root RT -5 0 0 0 S 0.0 0.0 0:00.00 migration/0.......
Command Description: View and sort the CPU usage of a process.
Free view memory usage
[root@localhost ~]# free total used free shared buffers cachedMem: 1035292 966592 68700 0 165876 416768-/+ buffers/cache: 383948 651344Swap: 2096472 284 2096188
Command Description: view memory usage
Top view process memory usage
[root@localhost ~]# top
Then, Enter Shift + M or m in the top command bar.
top - 13:48:52 up 102 days, 4:27, 1 user, load average: 0.00, 0.01, 0.00Tasks: 81 total, 2 running, 79 sleeping, 0 stopped, 0 zombieCpu(s): 0.0%us, 0.3%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%stMem: 1035292k total, 966592k used, 68700k free, 165876k buffersSwap: 2096472k total, 284k used, 2096188k free, 416784k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 4128 root 34 19 280m 266m 2112 S 0.0 26.4 1:48.40 yum-updatesd 8314 www 18 0 171m 34m 34m S 0.0 3.4 0:06.03 memcacheq 8280 www 15 0 88084 34m 588 S 0.0 3.4 0:01.23 memcached10907 mysql 15 0 122m 16m 3892 S 0.0 1.7 0:25.29 mysqld......
Command Description: view the memory usage of the process and sort it.
Obtain network traffic for an Interface
[root@localhost ~]# date;ifconfig eth0Sun Mar 13 13:51:29 CST 2011eth0 Link encap:Ethernet HWaddr 00:50:56:A4:0D:89 inet addr:172.10.7.215 Bcast:172.10.7.255 Mask:255.255.248.0 inet6 addr: fe80::250:56ff:fea4:d89/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:72113071 errors:12213 dropped:30790 overruns:0 frame:0 TX packets:1062902 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3311165612 (3.0 GiB) TX bytes:101244262 (96.5 MiB) Interrupt:59 Base address:0x2000[root@localhost ~]# date;ifconfig eth0Sun Mar 13 13:53:13 CST 2011eth0 Link encap:Ethernet HWaddr 00:50:56:A4:0D:89 inet addr:172.10.7.215 Bcast:172.10.7.255 Mask:255.255.248.0 inet6 addr: fe80::250:56ff:fea4:d89/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:72113528 errors:12213 dropped:30790 overruns:0 frame:0 TX packets:1062968 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3311204659 (3.0 GiB) TX bytes:101285190 (96.5 MiB) Interrupt:59 Base address:0x2000
Command Description: compare two time Network InterfacesRXAndTXData to obtain network traffic for an Interface