我前面把一个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