前面有使用過 Stressful Application Test (Stressapptest) https://benjr.tw/96740 這邊針對他的硬碟測試來做說明.
測試環境為 Ubuntu16.04 64bits
File Copy
執行 2 個檔案的 IO threads, 自動檢測 memory 大小與 core 數量以選擇分配的記憶體和記憶體複製線程 (threads).
root@ubuntu:~# stressapptest -f /tmp/file1 -f /tmp/file2 Log: Commandline - stressapptest -f /tmp/file1 -f /tmp/file2 Stats: SAT revision 1.0.6_autoconf, 64 bit binary Log: buildd @ kapok on Wed Jan 21 17:09:35 UTC 2015 from open source release Log: 1 nodes, 1 cpus. Log: Defaulting to 1 copy threads Log: Total 974 MB. Free 420 MB. Hugepages 0 MB. Targeting 828 MB (84%) Log: Prefer plain malloc memory allocation. Log: Using memaligned allocation at 0x7f6c11754000. Stats: Starting SAT, 828M, 20 seconds Log: Region mask: 0x1 Log: Seconds remaining: 10 Stats: Found 0 hardware incidents Stats: Completed: 5580.00M in 20.12s 277.32MB/s, with 0 hardware incidents, 0 errors Stats: Memory Copy: 1964.00M at 98.03MB/s Stats: File Copy: 3616.00M at 179.91MB/s Stats: Net Copy: 0.00M at 0.00MB/s Stats: Data Check: 0.00M at 0.00MB/s Stats: Invert Data: 0.00M at 0.00MB/s Stats: Disk: 0.00M at 0.00MB/s Status: PASS - please verify no corrected errors
使用參數:
- -f filename : add a disk thread with tempfile ‘filename’
這一次的測試結果可以看到除了 Memory 外 File Copy 也是有流量了.
Stats: Completed: 5580.00M in 20.12s 277.32MB/s, with 0 hardware incidents, 0 errors Stats: Memory Copy: 1964.00M at 98.03MB/s Stats: File Copy: 3616.00M at 179.91MB/s
Disk
使用參數:
- -d device : Add a direct write disk thread with block device (or file) ‘device’.
root@ubuntu:~# stressapptest -s 60 -M 500 -d /dev/sdb Log: Commandline - stressapptest -s 60 -M 500 -d /dev/sdb Stats: SAT revision 1.0.6_autoconf, 64 bit binary Log: buildd @ kapok on Wed Jan 21 17:09:35 UTC 2015 from open source release Log: 1 nodes, 1 cpus. Log: Defaulting to 1 copy threads Log: Prefer plain malloc memory allocation. Log: Using memaligned allocation at 0x7f574afeb000. Stats: Starting SAT, 500M, 60 seconds Log: Region mask: 0x1 Log: Seconds remaining: 50 Log: Seconds remaining: 40 Log: Seconds remaining: 30 Log: Seconds remaining: 20 Log: Seconds remaining: 10 Stats: Found 0 hardware incidents Stats: Completed: 321155.00M in 60.03s 5350.13MB/s, with 0 hardware incidents, 0 errors Stats: Memory Copy: 321086.00M at 5351.13MB/s Stats: File Copy: 0.00M at 0.00MB/s Stats: Net Copy: 0.00M at 0.00MB/s Stats: Data Check: 0.00M at 0.00MB/s Stats: Invert Data: 0.00M at 0.00MB/s Stats: Disk: 69.00M at 1.15MB/s Status: PASS - please verify no corrected errors
其他與硬碟相關的參數:
- –random-threads number : Number of random threads for each disk write thread.
- –blocks-per-segment number : Number of blocks to read/write per segment per iteration.
- –cache-size size : Size of disk cache.
- –destructive : Write/wipe disk partition.
- –read-block-size size : Size of block for reading.
- –read-threshold time : Maximum time (in us) a block read should take.
- –segment-size size : Size of segments to split disk into.
- –write-block-size size : Size of block for writing. If not defined, the size of block for writing will be defined as the size of block for reading.
- –write-threshold time : Maximum time (in us) a block write should take.
File 與 Disk 都是透過硬碟來跟記憶體做存取,不同的是 Disk 是直接使用 RAW Disk 做存取, File 需要在格式化的硬碟空間才能使用.
沒有解決問題,試試搜尋本站其他內容
One thought on “Linux command – Stressful Application Test (Disk)”