米尔MYD-YG2LX开发板内存、CPU等压力测试 全球快消息
MYD-YG2LX开发板进行基础信息查看,以及CPU、内存压力测试
2023-05-16 13:58:36
为了了解核心资源,今天根据《MYD-YG2LX_Linux软件评估指南.pdf》对开发板的核心资源进行测试。
读取系统中的 CPU 的提供商和参数信息,则可以通过/proc/cpuinfo 文件得到。
root@myir-yg2lx:~# cat /proc/cpuinfoprocessor : 0BogoMIPS : 48.00Features : fp asimd evtstrm crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddpCPU implementer : 0x41CPU architecture: 8CPU variant : 0x2CPU part : 0xd05CPU revision : 0processor : 1BogoMIPS : 48.00Features : fp asimd evtstrm crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddpCPU implementer : 0x41CPU architecture: 8CPU variant : 0x2CPU part : 0xd05CPU revision : 0
processor:系统中逻辑处理核的编号,对于多核处理器则可以是物理核、或者使用超线程技术虚拟的逻辑核BogoMIPS :在系统内核启动时粗略测算的 CPU 每秒运行百万条指令数(MillionInstructions Per Second)root@myir-yg2lx:~# toptop - 00:24:41 up 24 min, 1 user, loadaverage: 0.00, 0.00, 0.00Tasks: 107 total, 1 running, 106 sleeping, 0 stopped, 0 zombie%Cpu(s): 0.3 us, 0.5 sy, 0.0 ni, 98.8 id, 0.0 wa, 0.2 hi, 0.2 si, 0.0 stMiB Mem : 855.9 total, 430.8 free, 209.8 used, 215.4 buff/cacheMiB Swap: 0.0 total, 0.0 free, 0.0 used. 570.4 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 358 root 20 0 362852 70344 36348 S 0.7 8.0 0:12.13 mxapp2 548 root 20 0 4616 2460 2020 R 0.7 0.3 0:00.07 top 7 root 20 0 0 0 0 I 0.3 0.0 0:01.29 kworker+ 110 root 20 0 0 0 0 I 0.3 0.0 0:01.38 kworker+ 222 root 20 0 1784 412 348 S 0.3 0.0 0:00.18 watchdo+ 387 root 20 0 1432744 77964 35256 S 0.3 8.9 0:07.42 dockerd 396 root 20 0 1328624 45456 18588 S 0.3 5.2 0:06.68 contain+ 1 root 20 0 10352 7564 5036 S 0.0 0.9 0:05.77 systemd 2 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kthreadd 3 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_gp 4 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_par+ 8 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 mm_perc+ 9 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_tas+ 10 root 20 0 0 0 0 S 0.0 0.0 0:00.16 ksoftir+ 11 root 20 0 0 0 0 I 0.0 0.0 0:00.36 rcu_pre+ 12 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migrati+ 13 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/0
%us:表示用户空间程序的 cpu 使用率(没有通过 nice 调度)%sy:表示系统空间的 cpu 使用率,主要是内核程序%ni:表示用户空间且通过 nice 调度过的程序的 cpu 使用率%id:空闲 cpu%wa: 等待输入输出的 CPU 时间百分比%hi:cpu 处理硬中断的数量%si:cpu 处理软中断的数量 %st: 实时root@myir-yg2lx:~# cat /sys/class/thermal/thermal_zone0/temp47000
上面显示数字为千分之一度,除以 1000 就是当前温度值。
(资料图)
我们通过 bc 命令来计算圆周率方法来测试 CPU 在运算过程中的稳定性。
root@myir-yg2lx:/# echo "scale=5000; 4*a(1)" | bc -l -q &[1] 563root@myir-yg2lx:~# toptop - 00:33:31 up 33 min, 1 user, load average: 0.29, 0.09, 0.02Tasks: 108 total, 2 running, 106 sleeping, 0 stopped, 0 zombie%Cpu(s): 50.2 us, 0.3 sy, 0.0 ni, 49.3 id, 0.0 wa, 0.2 hi, 0.0 si, 0.0 stMiB Mem : 855.9 total, 464.7 free, 176.5 used, 214.7 buff/cacheMiB Swap: 0.0 total, 0.0 free, 0.0 used. 604.5 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 565 root 20 0 2760 1616 1360 R 100.0 0.2 0:18.92 bc 567 root 20 0 4616 2332 1892 R 0.7 0.3 0:00.09 top 11 root 20 0 0 0 0 I 0.3 0.0 0:00.46 rcu_pre+ 387 root 20 0 1432744 77964 35256 S 0.3 8.9 0:09.99 dockerd 396 root 20 0 1328624 45552 18588 S 0.3 5.2 0:09.17 contain+ 1 root 20 0 10352 7564 5036 S 0.0 0.9 0:05.94 systemd 2 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kthreadd 3 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_gp 4 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_par+ 7 root 20 0 0 0 0 I 0.0 0.0 0:01.74 kworker+ 8 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 mm_perc+ 9 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_tas+ 10 root 20 0 0 0 0 S 0.0 0.0 0:00.16 ksoftir+ 12 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migrati+ 13 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/0 14 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/1 15 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migrati+
我们看到CPU占用一直是100%
经过一段时间的测试,我们看到计算出了圆周率:
读取系统中的内存的参数信息,则可以通过/proc/meminfo 文件得到。
root@myir-yg2lx:~# cat /proc/meminfoMemTotal: 876452 kBMemFree: 476080 kBMemAvailable: 619184 kBBuffers: 5788 kBCached: 201480 kBSwapCached: 0 kBActive: 27224 kBInactive: 278828 kBActive(anon): 608 kBInactive(anon): 106696 kBActive(file): 26616 kBInactive(file): 172132 kBUnevictable: 0 kBMlocked: 0 kBSwapTotal: 0 kBSwapFree: 0 kBDirty: 4 kBWriteback: 0 kBAnonPages: 98852 kBMapped: 70956 kBShmem: 10436 kBKReclaimable: 12612 kBSlab: 71732 kBSReclaimable: 12612 kBSUnreclaim: 59120 kBKernelStack: 3232 kBPageTables: 2092 kBNFS_Unstable: 0 kBBounce: 0 kBWritebackTmp: 0 kBCommitLimit: 438224 kBCommitted_AS: 1093704 kBVmallocTotal: 135290159040 kBVmallocUsed: 4708 kBVmallocChunk: 0 kBPercpu: 680 kBAnonHugePages: 36864 kBShmemHugePages: 0 kBShmemPmdMapped: 0 kBFileHugePages: 0 kBFilePmdMapped: 0 kBCmaTotal: 393216 kBCmaFree: 238040 kBHugePages_Total: 0HugePages_Free: 0HugePages_Rsvd: 0HugePages_Surp: 0Hugepagesize: 2048 kBHugetlb: 0 kB
可使用 free 命令来读取内存的使用情况,-m 参数代表单位为 MByte。
total :内存总量 (我拿到的是1G的内存版本)used :被使用的内存量通过给定测试内存的大小和次数, 可以对系统现有的内存进行压力上的测试。可使用系统工具 memtester 进行测试,如指定内存大小 100MB,测试次数为 5,测试命令为
“memtester 100M 5"。
下列以使用 100MB 内存空间,单次测试为例:
root@myir-yg2lx:~# memtester 100M 5memtester version 4.3.0 (64-bit)Copyright (C) 2001-2012 Charles Cazabon.Licensed under the GNU General Public License version 2 (only).pagesize is 4096pagesizemask is 0xfffffffffffff000want 100MB (104857600 bytes)got 100MB (104857600 bytes), trying mlock ...locked.Loop 1/5: Stuck Address : ok Random Value : ok Compare XOR : ok Compare SUB : ok Compare MUL : ok Compare DIV : ok Compare OR : ok Compare AND : ok Sequential Increment: ok Solid Bits : ok Block Sequential : ok Checkerboard : ok Bit Spread : ok Bit Flip : ok Walking Ones : ok Walking Zeroes : okLoop 2/5: Stuck Address : ok Random Value : ok Compare XOR : ok Compare SUB : ok Compare MUL : ok Compare DIV : ok Compare OR : ok Compare AND : ok Sequential Increment: ok Solid Bits : ok Block Sequential : ok Checkerboard : ok Bit Spread : ok Bit Flip : ok Walking Ones : ok Walking Zeroes : okLoop 3/5: Stuck Address : ok Random Value : ok Compare XOR : ok Compare SUB : ok Compare MUL : ok Compare DIV : ok Compare OR : ok Compare AND : ok Sequential Increment: ok Solid Bits : ok Block Sequential : ok Checkerboard : ok Bit Spread : ok Bit Flip : ok Walking Ones : ok Walking Zeroes : okLoop 4/5: Stuck Address : ok Random Value : ok Compare XOR : ok Compare SUB : ok Compare MUL : ok Compare DIV : ok Compare OR : ok Compare AND : ok Sequential Increment: ok Solid Bits : ok Block Sequential : ok Checkerboard : ok Bit Spread : ok Bit Flip : ok Walking Ones : ok Walking Zeroes : okLoop 5/5: Stuck Address : ok Random Value : ok Compare XOR : ok Compare SUB : ok Compare MUL : ok Compare DIV : ok Compare OR : ok Compare AND : ok Sequential Increment: ok Solid Bits : ok Block Sequential : ok Checkerboard : ok Bit Spread : ok Bit Flip : ok Walking Ones : ok Walking Zeroes : okDone.
内存压力测试顺利通过。
【小结】
通以上的核心资源查看,并测试了CPU、内存的压力测试
标签: