目录

sysbench-实践-04-内存测试

sysbench–实践–04–内存测试

sysbench–实践–04–内存测试


1、介绍

测试内存连续读写性能

2、参数说明

sysbench  --test=memory help

https://i-blog.csdnimg.cn/blog_migrate/9095c7f739d3ab96cbc1045e2d0c336e.png#pic_center

2.1、–memory-block-size=SIZE

  1. 测试时内存块大小
  2. 默认值:1K。

2.2、–memory-total-size=SIZE

  1. 传输数据可使用的最大内存大小
  2. 默认值:100G。

2.3、–memory-scope=STRING

  1. 内存访问范围:global/local
  2. 默认值:global。

2.4、–memory-hugetlb=[on|off

  1. 从HugeTLB池分配内存
  2. 默认值:off。

2.5、–memory-oper=STRING

  1. 内存操作类型:
    1. read
    2. write
    3. none
  2. 默认值:write。

2.6、–memory-access-mode=STRING

  1. 内存访问方式:
    1. seq(顺序)
    2. rnd(随机)
  2. 默认值:seq。

3、操作

内存测试, 测试的内存块大小为8k,测试的数据量是1G

[root@zhoufei test]#  sysbench  memory --memory-block-size=8k --memory-total-size=1G run
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Running memory speed test with the following options:
  block size: 8KiB
  total size: 1024MiB
  operation: write
  scope: global

Initializing worker threads...

Threads started!

Total operations: 131072 (757986.53 per second)

1024.00 MiB transferred (5921.77 MiB/sec)


General statistics:
    total time:                          0.1696s
    total number of events:              131072

Latency (ms):
         min:                                    0.00
         avg:                                    0.00
         max:                                    0.40
         95th percentile:                        0.00
         sum:                                  135.76

Threads fairness:
    events (avg/stddev):           131072.0000/0.00
    execution time (avg/stddev):   0.1358/0.00