針對本次的測試說明如下: 1.使用Bryan提供的測試程式(XGW.STK.K1,以下簡稱XGW)(內含56000多筆的資料)來進行測試, 壓力測試程式在Windows 7(小黑nb,172.16.43.144)上執行 同時也執行了模擬後端主機(dbs)接收的的程式 2.本次的XGW在3台機器上分別進行驗證,不過主要以驗證PC -1為主,硬體與作業系統規格如下
PC - 1 | kernel | 2.6.18-164.el5PAE | |||
distribution | RHEL5.4(172.16.43.99) | ||||
memory | MemTotal: 3916364 kB | ||||
cpu | Intel(R) Core(TM)2 Quad CPU Q8400 @ 2.66GHz | ||||
disk | 500G 7200rpm(single) | ||||
PC - 2 | kernel | 2.6.18-92.el5 | |||
distribution | RHEL5.2(172.16.43.171) | ||||
memory | MemTotal: 3107452 kB | ||||
cpu | Intel(R) Pentium(R) Dual CPU E2140 @ 1.60GHz | ||||
disk | 160G 7200rpm(single) | ||||
PC - 3 | kernel | 2.6.18-194.el5 | |||
distribution | CentOS5.5(172.16.43.170) | ||||
memory | MemTotal: 16411680 kB | ||||
cpu | Intel(R) Xeon(R) CPU E5506 @ 2.13GHz(quard core * 2) | ||||
disk | 7200 rpm(raid-5, 146G*3) |
HDD | nr_requests | episode | time(sec) | min CPU idle% | avg CPU idle% | XGW useage% | wa%(inc. in idle) | PC2 time | PC3 time |
cfq | 64 | 0c0101092 | 173 | ||||||
128 | 0c0202092 | 157 | 44 | 68.09 | 45.66 | 19.2 | 168 | 82 | |
512 | 0c01020c1 | 121 | |||||||
1024 | 0c01030c1 | 85 | |||||||
2048 | 0c0103092 | 86 | 115 | 66 | |||||
4096 | 0c01010c1 | 93 | 35 | 63.26 | 56.06 | 18.65 | 116 | 65 | |
anticipatory | 64 | 0b0101012 | 159 | ||||||
128 | 0b0202012 | 153 | |||||||
2048 | 0b0103012 | 85 | 114 | 71 | |||||
4096 | 0b01010c1 | 77 | 55 | 72.88 | 62.8 | 11.04 | 115 | 69 | |
deadline | 64 | 0a0101012 | 171 | ||||||
128 | 0a0202012 | 159 | |||||||
2048 | 0a0103012 | 101 | 121 | 121 | |||||
noop | 64 | 0d01010b1 | 163 | ||||||
128 | 0d02020b1 | 171 | |||||||
2048 | 0d01030b1 | 140 | 181 | 231 |
ramdisk | nr_requests | episode | time diff |
cfq | 128 | - | 79 |
1024 | - | 79 | |
2048 | - | 76 | |
anticipatory | 128 | - | 79 |
監控目前HDD有在IO作業的PROCESS是哪一支
while true; do date; ps auxf | awk '{if($8=="D") print $0;}'; sleep 1; done
sleep 1若改usleep 300000, 則0.3秒監控一次,可以更快反應
其中,可以取得PID , 進一步透過/proc/PID/io 來找出相對應的read/write統計資料
rchar => This is the total reads caused by the process in bytes. This includes bytes read from the disk or from console
wchar => The same as rchar but it accounts for bytes written instead of read
read_bytes => Actual number of bytes read from the storage
write_bytes => Actual bytes written to the storage
Here's the script that shows you the top 5 processes which are reading data from disk:
grep read_bytes /proc/[0-9]*/io | sort -nrk2 | head -5
writing data, execute the following:
grep write_bytes /proc/[0-9]*/io | sort -nrk2 | head -5
There's also an utility called "iotop" which does the same thing in real time and gives you better top-like output
yum install iotop
/proc/PID/status, 則是方面的統計內容 參考資料: http://yoshinorimatsunobu.blogspot.com/2009/04/linux-io-scheduler-queue-size-and.html http://www.softpanorama.org/Commercial_linuxes/performance_tuning.shtml