我前面把一個Ubuntu
環境拷貝到了一個10Gbps
的硬盤盒制作了一個Ubuntu togo
的系統,帖子在這里,這篇文章主要用于測試使用Ubuntu togo
的系統和原生系統的性能差異。
以下是測試Ubuntu togo系統與原系統性能差異的具體方案,結合移動硬盤特性及參考資料中的關鍵信息整理:
我的測試的主機的信息如下:
> inxi -Fxz
System: Kernel: 5.15.0-131-generic x86_64 bits: 64 compiler: N/A Desktop: Gnome 3.36.9 Distro: Ubuntu 20.04.6 LTS (Focal Fossa)
Machine: Type: Laptop System: LENOVO product: 82JQ v: Lenovo Legion R9000P2021H serial: <filter> Mobo: LENOVO model: LNVNB161216 v: SDK0T76479 WIN serial: <filter> UEFI: LENOVO v: GKCN65WW date: 01/16/2024
Battery: ID-1: BAT0 charge: 69.0 Wh condition: 69.0/80.0 Wh (86%) model: Celxpert L20C4PC1 status: Full Device-1: hidpp_battery_0 model: Logitech MX Keys Wireless Keyboard charge: 100% (should be ignored) status: Discharging Device-2: hidpp_battery_1 model: Logitech Wireless Mouse MX Master 3 charge: 100% (should be ignored) status: Discharging
CPU: Topology: 8-Core model: AMD Ryzen 7 5800H with Radeon Graphics bits: 64 type: MT MCP arch: Zen 3 L2 cache: 4096 KiB flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 102200 Speed: 2746 MHz max: 3200 MHz Core speeds (MHz): 1: 2746 2: 2573 3: 2815 4: 3029 5: 3040 6: 2687 7: 3179 8: 3194 9: 3166 10: 2892 11: 2997 12: 3134 13: 2886 14: 3030 15: 2755 16: 2600
Graphics: Device-1: NVIDIA vendor: Lenovo driver: nvidia v: 555.42.02 bus ID: 01:00.0 Display: x11 server: X.Org 1.20.13 driver: nvidia unloaded: fbdev,modesetting,nouveau,vesa resolution: 2560x1440~60Hz, 2560x1600~60Hz OpenGL: renderer: NVIDIA GeForce RTX 3060 Laptop GPU/PCIe/SSE2 v: 4.6.0 NVIDIA 555.42.02 direct render: Yes
Audio: Device-1: NVIDIA driver: snd_hda_intel v: kernel bus ID: 01:00.1 Device-2: Advanced Micro Devices [AMD] Raven/Raven2/FireFlight/Renoir Audio Processor vendor: Lenovo driver: N/A bus ID: 06:00.5 Device-3: Advanced Micro Devices [AMD] Family 17h HD Audio vendor: Lenovo driver: snd_hda_intel v: kernel bus ID: 06:00.6 Sound Server: ALSA v: k5.15.0-131-generic
Network: Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Lenovo driver: r8169 v: kernel port: 1000 bus ID: 03:00.0 IF: eno1 state: down mac: <filter> Device-2: Intel Wi-Fi 6 AX200 driver: iwlwifi v: kernel port: 1000 bus ID: 04:00.0 IF: wlp4s0 state: up mac: <filter> IF-ID-1: br-67610ac5d589 state: down mac: <filter> IF-ID-2: br-7f68d848895d state: down mac: <filter> IF-ID-3: docker0 state: down mac: <filter>
Drives: Local Storage: total: 1.38 TiB used: 855.52 GiB (60.7%) ID-1: /dev/nvme0n1 vendor: Samsung model: MZVLB512HBJQ-000L2 size: 476.94 GiB temp: 32 C ID-2: /dev/nvme1n1 vendor: Crucial model: CT1000P2SSD8 size: 931.51 GiB temp: 37 C ID-3: /dev/sda type: USB model: SSK SSK Storage size: 931.51 GiB
Partition: ID-1: / size: 915.32 GiB used: 855.52 GiB (93.5%) fs: ext4 dev: /dev/sda2
Sensors: System Temperatures: cpu: 54.0 C mobo: N/A gpu: nvidia temp: 43 C Fan Speeds (RPM): N/A
Info: Processes: 455 Uptime: 21m Memory: 31.19 GiB used: 4.50 GiB (14.4%) Init: systemd runlevel: 5 Compilers: gcc: 9.4.0 Shell: zsh v: 5.8 inxi: 3.0.38
一、性能測試維度與工具
1. 磁盤讀寫性能測試
- 原因:移動硬盤的USB接口速度(如USB 3.0/3.2)和硬盤本身性能(如SATA/NVMe)直接影響系統響應速度。
- 工具:
fio
(測試順序/隨機讀寫速度):sudo apt-get install fio # 測試順序讀取(1GB文件,4K塊大小) fio --name=seq_read --rw=read --size=1G --bs=4k --direct=1 # 測試隨機寫入(1GB文件,4K塊大小) fio --name=rand_write --rw=randwrite --size=1G --bs=4k --direct=1
hdparm
(快速測試讀取速度):sudo hdparm -Tt /dev/sdX # 替換sdX為移動硬盤設備名
- 對比項:與原系統(如內置SSD/HDD)的磁盤速度差異。
2. 系統啟動與響應速度
- 啟動時間:
- 使用Ubuntu togo和原系統分別冷啟動,記錄從按下電源鍵到進入桌面的時間。
- 應用啟動速度:
- 測試常用軟件(如Firefox、LibreOffice)的首次啟動耗時:
time firefox # 記錄終端輸出的實際時間
- 測試常用軟件(如Firefox、LibreOffice)的首次啟動耗時:
3. CPU與內存性能
- 工具:
sysbench
(綜合性能測試):# CPU測試(計算素數至20000) sysbench cpu --cpu-max-prime=20000 run # 內存測試(讀寫速度) sysbench memory --memory-block-size=1K --memory-total-size=10G run
Geekbench
(跨平臺跑分工具):
下載Linux/Windows版,分別運行并對比分數。
4. 圖形與GPU性能(如適用)
- 工具:
glxgears
(OpenGL基礎性能):glxgears # 查看幀率(需安裝mesa-utils)
Unigine Heaven
(跨平臺GPU壓力測試):
在Ubuntu和原系統(如Windows)中運行,對比幀率與穩定性。
5. 實際場景測試
- 編譯性能:
# 編譯Linux內核(對比耗時) time make -j$(nproc) # 在相同項目目錄下執行
- 文件壓縮/解壓:
time tar -czf test.tar.gz /large_directory # 壓縮大文件夾 time tar -xzf test.tar.gz # 解壓對比時間
二、注意事項與優化建議
-
環境一致性:
- 確保兩臺系統在同一硬件上測試(如使用同一臺電腦啟動Ubuntu togo和原系統)。
- 關閉后臺程序,避免干擾測試結果。
-
移動硬盤性能瓶頸:
- USB接口速度可能限制磁盤性能,優先使用USB 3.2或雷電接口。
- 若使用U盤制作Ubuntu togo,性能可能顯著低于移動硬盤。
-
系統配置優化:
- Ubuntu togo建議禁用
swap
分區(減少外置存儲讀寫延遲)。 - 檢查驅動兼容性(如NVIDIA顯卡需安裝專有驅動)。
- Ubuntu togo建議禁用
三、參考資料支持
- Ubuntu與硬件性能關系:
- Ubuntu對英特爾CPU優化較好,可能優于Windows(參考)。
- 移動硬盤性能對系統流暢度影響顯著(參考)。
- 測試工具推薦:
sysbench
和Geekbench
為跨平臺標準工具(參考)。
通過上述測試,您可以量化Ubuntu togo與原系統的性能差異,并針對性優化(如升級硬盤盒或接口)。若測試顯示磁盤性能是瓶頸,可考慮更換NVMe硬盤盒或使用雷電接口設備。
四、測試結果與分析
4.1 Ubuntu togo性能測試結果分析(順序讀取測試)
# 測試順序讀取(1GB文件,4K塊大小)
> fio --name=seq_read --rw=read --size=1G --bs=4k --direct=1# 測試參數和全局信息
seq_read: (g=0): rw=read, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=1
- 測試名稱:seq_read(順序讀取)。
- 讀寫模式:rw=read(順序讀)。
- 測試文件大小:--size=1G(生成1GB的測試文件)。
- 塊大小:bs=4k(每次I/O操作讀取4KB數據)。
- 直接I/O:direct=1(繞過系統緩存,直接讀寫磁盤)。
- I/O引擎:ioengine=psync(同步I/O,每次操作等待完成)。
- I/O隊列深度:iodepth=1(每次只發1個I/O請求)。fio-3.16
Starting 1 process
seq_read: Laying out IO file (1 file / 1024MiB)# 測試進程和進度
Jobs: 1 (f=1): [R(1)][100.0%][r=46.9MiB/s][r=12.0k IOPS][eta 00m:00s]
- 進程數:1個進程執行測試。
- 實時帶寬:r=46.9MiB/s(每秒讀取46.9MiB)。
- 實時IOPS:r=12.0k(每秒12,000次I/O操作)。seq_read: (groupid=0, jobs=1): err= 0: pid=66537: Mon Mar 17 15:27:49 2025# 匯總性能指標read: IOPS=12.1k, BW=47.2MiB/s (49.5MB/s)(1024MiB/21702msec)- 平均IOPS:12.1k(每秒12,100次I/O操作)。- 平均帶寬:47.2MiB/s(約49.5MB/s)。- 總數據量:1024MiB(1GB)在21702毫秒(約21.7秒)內完成。# 延遲(Latency)統計clat (usec): min=68, max=1252, avg=77.61, stdev= 7.45lat (usec): min=69, max=1253, avg=78.84, stdev= 7.47- 命令完成延遲(clat):從I/O提交到完成的時間。- 最小值:68微秒(μs)。- 最大值:1252微秒。- 平均值:77.61微秒。- 標準差:7.45微秒(延遲波動小,性能穩定)。- 總延遲(lat):包括I/O提交和完成的全部時間(與clat接近,因為隊列深度為1)。# 延遲百分位數clat percentiles (usec):| 1.00th=[ 73], 5.00th=[ 74], 10.00th=[ 75], 20.00th=[ 75],| 30.00th=[ 77], 40.00th=[ 78], 50.00th=[ 78], 60.00th=[ 78],| 70.00th=[ 78], 80.00th=[ 79], 90.00th=[ 80], 95.00th=[ 84],| 99.00th=[ 97], 99.50th=[ 113], 99.90th=[ 139], 99.95th=[ 145],| 99.99th=[ 359]- 99%的請求在97微秒內完成。- 99.99%的請求在359微秒內完成(極少延遲異常值)。# 帶寬和IOPS波動bw ( KiB/s): min=47512, max=50008, per=100.00%, avg=48315.09, stdev=653.75, samples=43iops : min=11878, max=12502, avg=12078.77, stdev=163.43, samples=43- 帶寬波動:標準差653.75 KiB/s(波動小,性能穩定)。- IOPS波動:標準差163.43(波動小)。# 延遲分布lat (usec) : 100=99.22%, 250=0.76%, 500=0.01%, 750=0.01%, 1000=0.01%- 99.22%的請求延遲小于100微秒。- 0.76%的請求延遲在100-250微秒之間。lat (msec) : 2=0.01%# CPU和上下文切換 cpu : usr=1.55%, sys=25.80%, ctx=262153, majf=0, minf=13- 用戶態CPU占用:1.55%(處理I/O邏輯的開銷)。- 內核態CPU占用:25.80%(系統處理I/O的消耗,因direct=1繞過緩存)。- 上下文切換次數:262153次(進程因I/O等待頻繁切換)。# I/O隊列深度和提交模式IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%issued rwts: total=262144,0,0,0 short=0,0,0,0 dropped=0,0,0,0latency : target=0, window=0, percentile=100.00%, depth=1Run status group 0 (all jobs):READ: bw=47.2MiB/s (49.5MB/s), 47.2MiB/s-47.2MiB/s (49.5MB/s-49.5MB/s), io=1024MiB (1074MB), run=21702-21702msec# 磁盤統計(sda)
Disk stats (read/write):sda: ios=261363/254, merge=0/92, ticks=17487/65, in_queue=17580, util=99.60%- 讀取I/O次數:261363次。- 磁盤利用率:99.60%(磁盤接近滿載,可能是性能瓶頸)。
4.2 Ubuntu togo性能測試結果分析(順序寫入測試)
> fio --name=rand_write --rw=randwrite --size=1G --bs=4k --direct=1
rand_write: (g=0): rw=randwrite, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=1
fio-3.16
Starting 1 process
rand_write: Laying out IO file (1 file / 1024MiB)
Jobs: 1 (f=1): [w(1)][100.0%][w=41.0MiB/s][w=10.5k IOPS][eta 00m:00s]
rand_write: (groupid=0, jobs=1): err= 0: pid=72630: Mon Mar 17 15:32:32 2025write: IOPS=10.3k, BW=40.1MiB/s (42.1MB/s)(1024MiB/25526msec); 0 zone resetsclat (usec): min=67, max=2822, avg=91.72, stdev=20.23lat (usec): min=69, max=2823, avg=93.00, stdev=20.24clat percentiles (usec):| 1.00th=[ 84], 5.00th=[ 87], 10.00th=[ 88], 20.00th=[ 89],| 30.00th=[ 90], 40.00th=[ 90], 50.00th=[ 90], 60.00th=[ 91],| 70.00th=[ 91], 80.00th=[ 92], 90.00th=[ 96], 95.00th=[ 103],| 99.00th=[ 120], 99.50th=[ 130], 99.90th=[ 157], 99.95th=[ 176],| 99.99th=[ 1450]bw ( KiB/s): min=38792, max=42584, per=100.00%, avg=41076.47, stdev=701.75, samples=51iops : min= 9698, max=10646, avg=10269.12, stdev=175.44, samples=51lat (usec) : 100=93.36%, 250=6.61%, 500=0.01%, 750=0.01%, 1000=0.01%lat (msec) : 2=0.01%, 4=0.01%cpu : usr=2.05%, sys=35.85%, ctx=262236, majf=0, minf=11IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%issued rwts: total=0,262144,0,0 short=0,0,0,0 dropped=0,0,0,0latency : target=0, window=0, percentile=100.00%, depth=1Run status group 0 (all jobs):WRITE: bw=40.1MiB/s (42.1MB/s), 40.1MiB/s-40.1MiB/s (42.1MB/s-42.1MB/s), io=1024MiB (1074MB), run=25526-25526msecDisk stats (read/write):sda: ios=21/261061, merge=0/2990, ticks=4/18037, in_queue=18076, util=99.67%
4.3 Ubuntu togo性能測試結果分析(hdparm測試)
> sudo hdparm -Tt /dev/sda
/dev/sda:Timing cached reads: 29112 MB in 1.97 seconds = 14742.02 MB/secHDIO_DRIVE_CMD(identify) failed: Invalid argumentTiming buffered disk reads: 2118 MB in 3.00 seconds = 705.36 MB/sec
4.4 Ubuntu togo性能測試結果分析(常用軟件啟動速度測試)
> time google-chrome
Opening in existing browser session.
google-chrome 0.02s user 0.03s system 67% cpu 0.074 total
> time code
code 0.17s user 0.10s system 62% cpu 0.418 total
4.5 Ubuntu togo性能測試結果分析(sysbench CPU性能測試)
> sysbench cpu --cpu-max-prime=20000 run
sysbench 1.0.18 (using system LuaJIT 2.1.0-beta3)Running the test with following options:
Number of threads: 1
Initializing random number generator from current timePrime numbers limit: 20000Initializing worker threads...Threads started!CPU speed:events per second: 1406.35General statistics:total time: 10.0003stotal number of events: 14065Latency (ms):min: 0.70avg: 0.71max: 0.8795th percentile: 0.73sum: 9962.88Threads fairness:events (avg/stddev): 14065.0000/0.00execution time (avg/stddev): 9.9629/0.00
4.6 Ubuntu togo性能測試結果分析(glxgears顯卡性能測試)
> glxgears
Running synchronized to the vertical refresh. The framerate should be
approximately the same as the monitor refresh rate.
301 frames in 5.0 seconds = 60.184 FPS
298 frames in 5.0 seconds = 59.549 FPS
300 frames in 5.0 seconds = 59.945 FPS
300 frames in 5.0 seconds = 59.957 FPS
297 frames in 5.0 seconds = 59.344 FPS
298 frames in 5.0 seconds = 59.541 FPS
299 frames in 5.0 seconds = 59.748 FPS
4.7 Ubuntu 原生性能測試結果分析(順序讀取測試)
不使用緩存
> fio --name=seq_read --rw=read --size=1G --bs=4k --direct=1
seq_read: (g=0): rw=read, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=1
fio-3.16
Starting 1 process
Jobs: 1 (f=1): [R(1)][100.0%][r=19.4MiB/s][r=4962 IOPS][eta 00m:00s]
seq_read: (groupid=0, jobs=1): err= 0: pid=61096: Mon Mar 17 17:07:07 2025read: IOPS=4928, BW=19.3MiB/s (20.2MB/s)(1024MiB/53191msec)clat (usec): min=67, max=3902, avg=196.99, stdev=40.80lat (usec): min=68, max=3904, avg=198.36, stdev=40.80clat percentiles (usec):| 1.00th=[ 76], 5.00th=[ 80], 10.00th=[ 200], 20.00th=[ 202],| 30.00th=[ 204], 40.00th=[ 204], 50.00th=[ 204], 60.00th=[ 206],| 70.00th=[ 206], 80.00th=[ 208], 90.00th=[ 210], 95.00th=[ 215],| 99.00th=[ 225], 99.50th=[ 231], 99.90th=[ 251], 99.95th=[ 314],| 99.99th=[ 2089]bw ( KiB/s): min=19160, max=19960, per=99.98%, avg=19708.53, stdev=143.02, samples=106iops : min= 4790, max= 4990, avg=4927.13, stdev=35.75, samples=106lat (usec) : 100=7.08%, 250=92.81%, 500=0.08%, 750=0.01%, 1000=0.01%lat (msec) : 2=0.01%, 4=0.01%cpu : usr=0.83%, sys=9.47%, ctx=262154, majf=0, minf=13IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%issued rwts: total=262144,0,0,0 short=0,0,0,0 dropped=0,0,0,0latency : target=0, window=0, percentile=100.00%, depth=1Run status group 0 (all jobs):READ: bw=19.3MiB/s (20.2MB/s), 19.3MiB/s-19.3MiB/s (20.2MB/s-20.2MB/s), io=1024MiB (1074MB), run=53191-53191msecDisk stats (read/write):nvme1n1: ios=262660/758, merge=0/348, ticks=49055/119, in_queue=49230, util=99.91%
使用緩存
> fio --name=seq_read --rw=read --size=1G --bs=4k --direct=0
seq_read: (g=0): rw=read, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=1
fio-3.16
Starting 1 process
Jobs: 1 (f=1)
seq_read: (groupid=0, jobs=1): err= 0: pid=62615: Mon Mar 17 17:07:40 2025read: IOPS=107k, BW=419MiB/s (439MB/s)(1024MiB/2446msec)clat (nsec): min=908, max=240603, avg=3853.35, stdev=10121.18lat (usec): min=2, max=242, avg= 5.18, stdev=10.13clat percentiles (usec):| 1.00th=[ 3], 5.00th=[ 3], 10.00th=[ 3], 20.00th=[ 3],| 30.00th=[ 3], 40.00th=[ 3], 50.00th=[ 3], 60.00th=[ 3],| 70.00th=[ 3], 80.00th=[ 3], 90.00th=[ 3], 95.00th=[ 3],| 99.00th=[ 82], 99.50th=[ 84], 99.90th=[ 93], 99.95th=[ 101],| 99.99th=[ 114]bw ( KiB/s): min=423672, max=431584, per=99.96%, avg=428532.00, stdev=3395.69, samples=4iops : min=105918, max=107896, avg=107133.00, stdev=848.92, samples=4lat (nsec) : 1000=0.01%lat (usec) : 2=0.75%, 4=96.96%, 10=0.62%, 20=0.06%, 50=0.03%lat (usec) : 100=1.51%, 250=0.06%cpu : usr=11.08%, sys=88.75%, ctx=244, majf=0, minf=11IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%issued rwts: total=262144,0,0,0 short=0,0,0,0 dropped=0,0,0,0latency : target=0, window=0, percentile=100.00%, depth=1Run status group 0 (all jobs):READ: bw=419MiB/s (439MB/s), 419MiB/s-419MiB/s (439MB/s-439MB/s), io=1024MiB (1074MB), run=2446-2446msecDisk stats (read/write):nvme1n1: ios=4054/53, merge=0/3, ticks=1292/3, in_queue=1295, util=96.57%
4.8 Ubuntu togo性能測試結果分析(順序寫入測試)
不使用緩存
> fio --name=rand_write --rw=randwrite --size=1G --bs=4k --direct=1
rand_write: (g=0): rw=randwrite, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=1
fio-3.16
Starting 1 process
Jobs: 1 (f=1): [w(1)][100.0%][w=130MiB/s][w=33.2k IOPS][eta 00m:00s]
rand_write: (groupid=0, jobs=1): err= 0: pid=64849: Mon Mar 17 17:09:50 2025write: IOPS=32.6k, BW=127MiB/s (133MB/s)(1024MiB/8051msec); 0 zone resetsclat (usec): min=19, max=10131, avg=24.96, stdev=29.84lat (usec): min=21, max=10133, avg=26.31, stdev=29.85clat percentiles (usec):| 1.00th=[ 23], 5.00th=[ 24], 10.00th=[ 24], 20.00th=[ 24],| 30.00th=[ 24], 40.00th=[ 24], 50.00th=[ 24], 60.00th=[ 25],| 70.00th=[ 25], 80.00th=[ 26], 90.00th=[ 28], 95.00th=[ 30],| 99.00th=[ 35], 99.50th=[ 40], 99.90th=[ 45], 99.95th=[ 50],| 99.99th=[ 129]bw ( KiB/s): min=122536, max=133728, per=100.00%, avg=130236.38, stdev=3490.35, samples=16iops : min=30634, max=33432, avg=32559.06, stdev=872.56, samples=16lat (usec) : 20=0.01%, 50=99.95%, 100=0.03%, 250=0.01%, 500=0.01%lat (usec) : 750=0.01%lat (msec) : 4=0.01%, 10=0.01%, 20=0.01%cpu : usr=5.53%, sys=63.63%, ctx=262120, majf=0, minf=9IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%issued rwts: total=0,262144,0,0 short=0,0,0,0 dropped=0,0,0,0latency : target=0, window=0, percentile=100.00%, depth=1Run status group 0 (all jobs):WRITE: bw=127MiB/s (133MB/s), 127MiB/s-127MiB/s (133MB/s-133MB/s), io=1024MiB (1074MB), run=8051-8051msecDisk stats (read/write):nvme1n1: ios=105/256805, merge=0/38, ticks=27/3448, in_queue=3488, util=98.90%
使用緩存
> fio --name=rand_write --rw=randwrite --size=1G --bs=4k --direct=0
rand_write: (g=0): rw=randwrite, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=1
fio-3.16
Starting 1 process
Jobs: 1 (f=1): [w(1)][-.-%][w=320MiB/s][w=81.8k IOPS][eta 00m:00s]
rand_write: (groupid=0, jobs=1): err= 0: pid=66363: Mon Mar 17 17:11:11 2025write: IOPS=82.2k, BW=321MiB/s (337MB/s)(1024MiB/3190msec); 0 zone resetsclat (nsec): min=4679, max=66559, avg=6633.45, stdev=933.32lat (nsec): min=6076, max=67467, avg=7975.00, stdev=1020.52clat percentiles (nsec):| 1.00th=[ 5792], 5.00th=[ 6048], 10.00th=[ 6176], 20.00th=[ 6240],| 30.00th=[ 6240], 40.00th=[ 6304], 50.00th=[ 6368], 60.00th=[ 6624],| 70.00th=[ 6624], 80.00th=[ 6752], 90.00th=[ 7520], 95.00th=[ 7968],| 99.00th=[ 9024], 99.50th=[10048], 99.90th=[18048], 99.95th=[25216],| 99.99th=[31104]bw ( KiB/s): min=325840, max=329808, per=99.97%, avg=328616.00, stdev=1411.19, samples=6iops : min=81460, max=82452, avg=82154.00, stdev=352.80, samples=6lat (usec) : 10=99.52%, 20=0.41%, 50=0.07%, 100=0.01%cpu : usr=9.25%, sys=90.66%, ctx=326, majf=0, minf=8IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%issued rwts: total=0,262144,0,0 short=0,0,0,0 dropped=0,0,0,0latency : target=0, window=0, percentile=100.00%, depth=1Run status group 0 (all jobs):WRITE: bw=321MiB/s (337MB/s), 321MiB/s-321MiB/s (337MB/s-337MB/s), io=1024MiB (1074MB), run=3190-3190msecDisk stats (read/write):nvme1n1: ios=65/567, merge=0/33, ticks=62/111, in_queue=174, util=6.33%
4.9 Ubuntu togo性能測試結果分析(hdparm測試)
> sudo hdparm -Tt /dev/nvme1n1p4/dev/nvme1n1p4:Timing cached reads: 29206 MB in 1.98 seconds = 14784.34 MB/secHDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for deviceTiming buffered disk reads: 1380 MB in 3.00 seconds = 459.71 MB/sec
> sudo hdparm -Tt /dev/nvme1n1p1/dev/nvme1n1p1:Timing cached reads: 29000 MB in 1.98 seconds = 14679.55 MB/secHDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for deviceTiming buffered disk reads: 14 MB in 0.01 seconds = 1473.84 MB/sec
4.10 Ubuntu togo性能測試結果分析(常用軟件啟動速度測試)
> time google-chrome
Opening in existing browser session.
google-chrome 0.02s user 0.02s system 58% cpu 0.068 total
> time code
code 0.17s user 0.09s system 47% cpu 0.557 total
4.11 Ubuntu togo性能測試結果分析(sysbench CPU性能測試)
> sysbench cpu --cpu-max-prime=20000 run
sysbench 1.0.18 (using system LuaJIT 2.1.0-beta3)Running the test with following options:
Number of threads: 1
Initializing random number generator from current timePrime numbers limit: 20000Initializing worker threads...Threads started!CPU speed:events per second: 1399.10General statistics:total time: 10.0007stotal number of events: 13993Latency (ms):min: 0.70avg: 0.71max: 1.3095th percentile: 0.73sum: 9960.00Threads fairness:events (avg/stddev): 13993.0000/0.00execution time (avg/stddev): 9.9600/0.00
4.12 Ubuntu togo性能測試結果分析(glxgears顯卡性能測試)
> glxgears
Running synchronized to the vertical refresh. The framerate should be
approximately the same as the monitor refresh rate.
298 frames in 5.0 seconds = 59.587 FPS
300 frames in 5.0 seconds = 59.953 FPS
300 frames in 5.0 seconds = 59.936 FPS
299 frames in 5.0 seconds = 59.750 FPS
299 frames in 5.0 seconds = 59.752 FPS
300 frames in 5.0 seconds = 59.944 FPS
300 frames in 5.0 seconds = 59.956 FPS