内存速度的一个简单验证
背景
Linux Drop cache的效率
CPU型号 | drop_caches的速度 |
飞腾S2500 | 1.64GB/S |
E5-2620 | 1.84GB/S |
Golden 6150 | 3.86GB/S |
AMD9T34 | 3.46GB/S |
Golden 8269CY | 6.47GB/S |
- 说明
非常不严格的计算
虚拟机的话速度会稍慢, AMD的内存太少,计算较为吃亏
简单总结
其实可以使用类似于 stream等的工具进行测试.
但是总感觉stream的测试结果总是与体感不太一样
这个此时数据其实很不准确,但是依旧可以看到
新的服务器的内存带宽要多倍于国产的机器和十年前的老机器
我理解虽然现在 服务器都是六通道 八通道 都内存条的插法
但是真正进行内存回收时还是需要对应的numa节点挨个进行处理的
并不能够很快的完全使用所有的内存带宽
虽然总体的水管变粗了 但是干活时可能还是得用单独个一个水管.
所以很多新能测试的玩法其实是绑定核心绑定通道.
于实际生产 大量的 上下文切换核心转换是不一样的.
Linux Drop cache的效率(原始信息)
1. 飞腾S2500
[root@testcenterxc02 ~]# free -g
total used free shared buff/cache available
Mem: 1021 309 297 397 414 230
Swap: 0 0 0
[root@testcenterxc02 ~]# time echo 3 >/proc/sys/vm/drop_caches
real 0m7.907s
user 0m0.000s
sys 0m7.837s
[root@testcenterxc02 ~]# free -g
total used free shared buff/cache available
Mem: 1021 309 310 397 401 236
2. Intel的E5-2620
[root@10.110.80.19 ~]free -g
total used free shared buff/cache available
Mem: 31 19 1 1 10 9
Swap: 0 0 0
[root@10.110.80.19 ~] time echo 3 >/proc/sys/vm/drop_caches
real 0m4.355s
user 0m0.001s
sys 0m3.839s
[root@10.110.80.19 ~]free -g
total used free shared buff/cache available
Mem: 31 19 9 1 2 10
Swap: 0 0 0
3. Intel的Golden 6150
[root@testsvr116 ~]# free -g
total used free shared buff/cache available
Mem: 1007 613 115 94 278 273
Swap: 0 0 0
[root@testsvr116 ~]# time echo 3 >/proc/sys/vm/drop_caches
real 0m46.592s
user 0m0.001s
sys 0m46.406s
[root@testsvr116 ~]# free -g
total used free shared buff/cache available
Mem: 1007 613 295 94 98 284
Swap: 0 0 0
4. 阿里云的AMD9T34虚拟机
[root@dsmart ~]# free -g
total used free shared buff/cache available
Mem: 30 22 1 0 5 7
Swap: 0 0 0
[root@dsmart ~]# time echo 3 >/proc/sys/vm/drop_caches
real 0m1.155s
user 0m0.000s
sys 0m1.048s
[root@dsmart ~]# free -g
total used free shared buff/cache available
Mem: 30 22 7 0 1 7
Swap: 0 0 0
[root@dsmart ~]#
5. Intel的 Golden 8269CY
[root@GSCloudPG15 ~]# free -g
total used free shared buff/cache available
Mem: 61 35 3 4 22 15
Swap: 0 0 0
[root@GSCloudPG15 ~]# time echo 3 >/proc/sys/vm/drop_caches
real 0m2.629s
user 0m0.003s
sys 0m2.574s
[root@GSCloudPG15 ~]# free -g
total used free shared buff/cache available
Mem: 61 35 20 4 5 17
Swap: 0 0 0
[root@GSCloudPG15 ~]#