ITPub博客

首页 > 数据库 > MySQL > 测试软件:sysbench-cpu

测试软件:sysbench-cpu

原创 MySQL 作者:javenzhen 时间:2015-07-20 20:37:25 0 删除 编辑
1、查看CPU个数和线程数

  1. root@pm1:/root# grep "physical id" /proc/cpuinfo
  2. physical id : 0
  3. physical id : 0
  4. physical id : 0
  5. physical id : 0
  6. root@pm1:/root# grep "processor" /proc/cpuinfo
  7. processor : 0
  8. processor : 1
  9. processor : 2
  10. processor : 3
我是在1个物理CPU,4线程的虚拟机上做的测试

2、下面分别使用线程数2和4在虚拟机和PC服务器上做的测试
虚拟机线程数2

  1. root@pm1:/root# sysbench --test=cpu --num-threads=2 --cpu-max-prime=50000 run
  2. sysbench 0.5: multi-threaded system evaluation benchmark

  3. Running the test with following options:
  4. Number of threads: 2
  5. Random number generator seed is 0 and will be ignored


  6. Primer numbers limit: 50000

  7. Threads


  8. General statistics:
  9.     total time: 55.5011s
  10.     total number of events: 10000
  11.     total time taken by event execution: 110.8806s
  12.     response time:
  13.          min: 8.79ms
  14.          avg: 11.09ms
  15.          max: 58.89ms
  16.          approx. 95 percentile: 13.64ms

  17. Threads fairness:
  18.     events (avg/stddev): 5000.0000/2.00
  19.     execution time (avg/stddev): 55.4403/0.00
PC服务器线程数2

  1. [root@ ~]# sysbench --test=cpu --num-threads=2 --cpu-max-prime=50000 run
  2. sysbench 0.5: multi-threaded system evaluation benchmark

  3. Running the test with following options:
  4. Number of threads: 2
  5. Random number generator seed is 0 and will be ignored


  6. Primer numbers limit: 50000

  7. Threads


  8. General statistics:
  9.     total time: 46.5507s
  10.     total number of events: 10000
  11.     total time taken by event execution: 93.0934s
  12.     response time:
  13.          min: 9.24ms
  14.          avg: 9.31ms
  15.          max: 13.10ms
  16.          approx. 95 percentile: 9.46ms

  17. Threads fairness:
  18.     events (avg/stddev): 5000.0000/13.00
  19.     execution time (avg/stddev): 46.5467/0.00
虚拟机线程数4

  1. root@pm1:/root# sysbench --test=cpu --num-threads=4 --cpu-max-prime=50000 run
  2. sysbench 0.5: multi-threaded system evaluation benchmark

  3. Running the test with following options:
  4. Number of threads: 4
  5. Random number generator seed is 0 and will be ignored


  6. Primer numbers limit: 50000

  7. Threads


  8. General statistics:
  9.     total time: 36.6124s
  10.     total number of events: 10000
  11.     total time taken by event execution: 146.2491s
  12.     response time:
  13.          min: 9.57ms
  14.          avg: 14.62ms
  15.          max: 126.70ms
  16.          approx. 95 percentile: 17.99ms

  17. Threads fairness:
  18.     events (avg/stddev): 2500.0000/18.81
  19.     execution time (avg/stddev): 36.5623/0.02
PC服务器线程数4

  1. [root@ ~]# sysbench --test=cpu --num-threads=4 --cpu-max-prime=50000 run
  2. sysbench 0.5: multi-threaded system evaluation benchmark

  3. Running the test with following options:
  4. Number of threads: 4
  5. Random number generator seed is 0 and will be ignored


  6. Primer numbers limit: 50000

  7. Threads


  8. General statistics:
  9.     total time: 23.2432s
  10.     total number of events: 10000
  11.     total time taken by event execution: 92.9494s
  12.     response time:
  13.          min: 9.24ms
  14.          avg: 9.29ms
  15.          max: 13.87ms
  16.          approx. 95 percentile: 9.46ms

  17. Threads fairness:
  18.     events (avg/stddev): 2500.0000/12.51
  19.     execution time (avg/stddev): 23.2374/0.00

很明显在最大相应时间上差别是比较大的,在测试CPU的时候,需要关注的total time和response time,这里只是做一个比较而已,其实意义不大。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12219480/viewspace-1742487/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-01-27

  • 博文量
    41
  • 访问量
    88877