akopytov / sysbench

Scriptable database and system performance benchmark
GNU General Public License v2.0
6.03k stars 1.08k forks source link

percentile and histogram not working #479

Open dichenli opened 1 year ago

dichenli commented 1 year ago

When running any sysbench test on my Macbook, the percentile value is always 0, and histogram doesn't work, e.g.:

% sysbench --version
sysbench 1.0.20

% sysbench --test=cpu --cpu-max-prime=20000 --histogram=on run
WARNING: the --test option is deprecated. You can pass a script name or path on the command line without any options.
sysbench 1.0.20 (using system LuaJIT 2.1.0-beta3)

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

Prime numbers limit: 20000

Initializing worker threads...

Threads started!

Latency histogram (values are in milliseconds)

CPU speed:
    events per second: 13373155.28

General statistics:
    total time:                          10.0004s
    total number of events:              133738547

Latency (ms):
         min:                                    0.00
         avg:                                    0.00
         max:                                    0.26
         95th percentile:                        0.00
         sum:                                 3725.42

Threads fairness:
    events (avg/stddev):           133738547.0000/0.00
    execution time (avg/stddev):   3.7254/0.00

The Macbook is on Apple M1 chip. I installed the sysbench with brew install sysbench:

% brew info sysbench
==> sysbench: stable 1.0.20 (bottled), HEAD
System performance benchmark tool
https://github.com/akopytov/sysbench
/opt/homebrew/Cellar/sysbench/1.0.20_3 (89 files, 588.6KB) *
  Poured from bottle on 2022-12-29 at 19:35:48
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/sysbench.rb
License: GPL-2.0-or-later
......

% brew install sysbench
......
Warning: sysbench 1.0.20_3 is already installed and up-to-date.
......

I also installed sysbench on a Linux machine (x86 arch) following https://github.com/akopytov/sysbench#linux , it worked fine:

% sudo yum -y install sysbench
......
Installed:
  sysbench.x86_64 0:1.0.20-1.el7     
......

% sysbench --version
sysbench 1.0.20

% sysbench --test=cpu --cpu-max-prime=20000 --histogram=on run
WARNING: the --test option is deprecated. You can pass a script name or path on the command line without any options.
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

Prime numbers limit: 20000

Initializing worker threads...

Threads started!

Latency histogram (values are in milliseconds)
       value  ------------- distribution ------------- count
       2.913 |*************                            811
       2.966 |**************************************** 2561
       3.020 |                                         5
       3.075 |                                         5
       3.130 |                                         2
       3.187 |                                         2
       3.304 |                                         4
       3.425 |                                         1
       3.551 |                                         4

CPU speed:
    events per second:   339.27

General statistics:
    total time:                          10.0050s
    total number of events:              3395

Latency (ms):
         min:                                    2.93
         avg:                                    2.95
         max:                                    3.54
         95th percentile:                        2.97
         sum:                                 9998.45

Threads fairness:
    events (avg/stddev):           3395.0000/0.00
    execution time (avg/stddev):   9.9984/0.00

I also tried a few other tests: fileio, memory, mysql oltp_write_only.lua, etc. All the same: histogram and percentile work on the linux host, but not on my macbook.

I'm not sure what goes wrong. Some help would be much appreciated!

palashkulsh commented 1 year ago

I'm facing same behaviour on my mac m1 , latency 95 p and histogram dont come

huangjinxiang commented 1 year ago

I have the same problem when testing on mysql, everytime.

Latency (ms): min: 0.72 avg: 21.76 max: 200.40 95th percentile: 0.00 sum: 3000530.17