orion的簡單測試
orion是一個做IO測試的小巧工具,可以測試隨機讀寫,類比混合負載等。在Oracle 11g已經內建包含了這一工具,無須額外的安裝了,為IO方面的測試帶來了不少的便利。
當然如此簡單的小工具我在使用時還是碰到了些小問題。簡單總結一下。
首先是使用orion,直接提示依賴連結庫的問題
[oracle@db117 bin]$ orion
orion: error while loading shared libraries: libclntsh.so.11.1: cannot open shared object file: No such file or directory
因為這個資料庫是新安裝的,所以感覺是不是複製安裝沒初始化好,但是發現還是和變數LD_LIBRARY_PATH有關。
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/lib:/usr/X11R6/lib:/usr/local/lib
添加環境變數,就馬上可以了。
[oracle@db117 ~]$ orion
ORION: ORacle IO Numbers -- Version 11.2.0.4.0
Error in input parameters. For help, run: orion -help.
orion就這樣正式啟用了,就如同sqlplus一樣,都是$ORACLE_HOME/bin小的小工具。
我們測試的環境如下,使用的是機械硬碟。
[oracle@db117 ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda5 9.9G 2.4G 7.0G 26% /
tmpfs 32G 0 32G 0% /dev/shm
/dev/sda1 388M 62M 307M 17% /boot
/dev/sda6 1.1T 92G 908G 10% /home
/dev/sda2 20G 344M 19G 2% /var
在使用orion的時候,需要定義一個檔案,以.lun結尾。比如iotest.lun
我們要測試的裝置為/dev/sda6,在iotest.lun裡面就寫這個裝置即可。
可以使用下面的方式來嘗試啟用 testname對應的參數值就是iotest
orion -run oltp -testname iotest
當然這個命令使用還是有一些小技巧的,比如直接啟用,會有下面的錯誤。
[oracle@db117 temp]$ orion -run oltp -testname iotest
ORION: ORacle IO Numbers -- Version 11.2.0.4.0
************************ Large Pages Information *******************
Parameter use_large_pages = onlyPer process system memlock (soft) limit = 64 KB
Large Pages unused system wide = 0 (0 KB)
Large Pages configured system wide = 0 (0 KB)
Large Page size = 2048 KB
ERROR:
Failed to allocate shared global region with large pages, unix errno = 1.
Aborting the run of Orion. ORA-27137: unable to allocate Large Pages to create a shared memory segment
ACTION:
1. Check the permission to access system large pages.
2. Large pages are automatically locked into physical memory.
Increase the per process memlock (soft) limit to at least 8192 KB to lock
100% Orion I/O Buf Area's large pages into physical memory
*******************************************************************
Increase huge pages as suggested or set -hugenotneeded flag on command line
Failed to create shared memory of size 1051296 (orion_setup_shmem:skgmcreate)
Linux-x86_64 Error: 1: Operation not permitted
Additional information: 2097152
orion_parse_args: orion_setup_shmem failed
當然提示資訊已經很明顯了,當前環境沒有配置大頁,所以還是需要配置大頁或者聲明不需要大頁。
可以使用hugenotneeded來聲明,當然還是有一些小問題。
[oracle@db117 temp]$ orion -run simple -testname iotest -hugenotneeded
ORION: ORacle IO Numbers -- Version 11.2.0.4.0
iotest_20160420_1609
Calibration will take approximately 9 minutes.
Using a large value for -cache_size may take longer.
ORA-56727: orion must be invoked using its full, absolute path
orion_main: orion_spawn sml failed
Test aborted due to errors.
這個命令要求使用完整路徑,不要用相對路徑,修改為完整路徑繼續測試。
[oracle@db117 temp]$ $ORACLE_HOME/bin/orion -run simple -testname iotest -hugenotneeded
ORION: ORacle IO Numbers -- Version 11.2.0.4.0
iotest_20160420_1610
Calibration will take approximately 9 minutes.
Using a large value for -cache_size may take longer.
Error identifying file /dev/sda6 (storax_skgfr_openfiles:skgfifi)
ORA-27041: see Oracle documentation for information on error
Linux-x86_64 Error: 13: Permission denied
Additional information: 9
Test aborted due to errors.
這個時候提示是許可權不足,原來使用的oracle使用者沒有更高的許可權來操作/dev/sda6,所以可以調整許可權或者直接使用root來運行。
使用dd命令來測試/dev/sda6是否可用。
[root@db117 ~]# dd if=/dev/sda6 of=/dev/null bs=32k count=1024
1024+0 records in
1024+0 records out
33554432 bytes (34 MB) copied, 0.052941 s, 634 MB/s
當然把oracle使用者下的.bash_profile中的環境變數初始化到root使用者下,即可使用orion
如果想簡單一試,可以使用下面的命令,產生的測試時間是不能改動的。簡單等待之後,輸出的簡單報告如下
[root@db117 temp]# /U01/app/oracle/product/11.2.0.4/bin/orion -run simple -testname iotest -hugenotneeded
ORION: ORacle IO Numbers -- Version 11.2.0.4.0
iotest_20160420_1631
Calibration will take approximately 9 minutes.
Using a large value for -cache_size may take longer.
Maximum Large MBPS=210.16 @ Small=0 and Large=2
Maximum Small IOPS=894 @ Small=5 and Large=0
Small Read Latency: avg=5591 us, min=32 us, max=35791 us, std dev=2949 us @ Small=5 and Large=0
Minimum Small Latency=4320 usecs @ Small=1 and Large=0
Small Read Latency: avg=4320 us, min=78 us, max=18253 us, std dev=1378 us @ Small=1 and Large=0
Small Read / Write Latency Histogram @ Small=1 and Large=0
Latency: # of IOs (read) # of IOs (write)
0 - 1 us: 0 0
2 - 4 us: 0 0
4 - 8 us: 0 0
8 - 16 us: 0 0
16 - 32 us: 0 0
32 - 64 us: 0 0
64 - 128 us: 11 0
128 - 256 us: 0 0
256 - 512 us: 0 0
512 - 1024 us: 2 0
1024 - 2048 us: 538 0
2048 - 4096 us: 5625 0
4096 - 8192 us: 7680 0
8192 - 16384 us: 22 0
16384 - 32768 us: 1 0
32768 - 65536 us: 0 0
65536 - 131072 us: 0 0
131072 - 262144 us: 0 0
262144 - 524288 us: 0 0
524288 - 1048576 us: 0 0
1048576 - 2097152 us: 0 0
2097152 - 4194304 us: 0 0
4194304 - 8388608 us: 0 0
8388608 - 16777216 us: 0 0
16777216 - 33554432 us: 0 0
33554432 - 67108864 us: 0 0
67108864 - 134217728 us: 0 0
134217728 - 268435456 us: 0 0
當然還可以使用oltp的選項來測試
/U01/app/oracle/product/11.2.0.4/bin/orion -run oltp -testname iotest -hugenotneeded
[root@db117 temp]# /U01/app/oracle/product/11.2.0.4/bin/orion -run oltp -testname iotest -hugenotneeded
ORION: ORacle IO Numbers -- Version 11.2.0.4.0
iotest_20160420_1641
Calibration will take approximately 22 minutes.
Using a large value for -cache_size may take longer.
Maximum Small IOPS=1940 @ Small=20 and Large=0
Small Read Latency: avg=10305 us, min=42 us, max=209322 us, std dev=8938 us @ Small=20 and Large=0
Minimum Small Latency=4311 usecs @ Small=1 and Large=0
Small Read Latency: avg=4311 us, min=58 us, max=16964 us, std dev=1376 us @ Small=1 and Large=0
Small Read / Write Latency Histogram @ Small=1 and Large=0
或者測試8k的隨機讀寫
/U01/app/oracle/product/11.2.0.4/bin/orion -run advanced -num_large 0 -size_small 8 -type rand -simulate raid0 -write 0 -duration 10 -matrix row -testname iotest
[root@db117 temp]# /U01/app/oracle/product/11.2.0.4/bin/orion -run advanced -num_large 0 -size_small 8 -type rand -simulate raid0 -write 0 -duration 10 -matrix row -testname iotest
ORION: ORacle IO Numbers -- Version 11.2.0.4.0
iotest_20160420_1708
Calibration will take approximately 2 minutes.
Using a large value for -cache_size may take longer.
Maximum Small IOPS=895 @ Small=5 and Large=0
Small Read Latency: avg=5581 us, min=55 us, max=41177 us, std dev=2968 us @ Small=5 and Large=0