????????????
??????CPU?????????
??????????cpu????
????grep "physical id" /proc/cpuinfo | sort -u | wc -l
??????????????
????grep "core id" /proc/cpuinfo | sort -u | wc -l
?????????????
????grep "processor" /proc/cpuinfo | sort -u | wc -l
??????sysbench??????У?--num-threads???"???????"??????????????????壬????????????????
????3.2 ???(thread)????
???????????????????????????????????2??????????????????????á?
????sysbench --test=threads --num-threads=64 run
??????????????????

 

Number of threads: 64
Doing thread subsystem performance test
Thread yields per test: 1000 Locks used: 8
Threads started!
Done.
Test execution summary:
total time: 4.5845s
total number of events: 10000
total time taken by event execution: 291.9995
per-request statistics:
min: 0.76ms
avg: 29.20ms
max: 152.71ms
approx. 95 percentile: 71.11ms
Threads fairness:
events (avg/stddev): 156.2500/5.81
execution time (avg/stddev): 4.5625/0.02

?????????????????????????????????????????????????????????????е??????????????г????????? ????????????????????????????????????????? ????????????total time:???ж????????????????????????????????????????????????

 

Number of threads: 64
Doing thread subsystem performance test
Thread yields per test: 1000 Locks used: 8
Threads started!
Done.
Test execution summary:
total time: 2.4829s
total number of events: 10000
total time taken by event execution: 157.3468
per-request statistics:
min: 0.21ms
avg: 15.73ms
max: 166.69ms
approx. 95 percentile: 119.14ms
Threads fairness:
events (avg/stddev): 156.2500/22.25
execution time (avg/stddev): 2.4585/0.02

???????????total time ????????????????????????????????????????????????????

????3.3 ??????(mutex)
????????????????????????????????????????????????У???????????????????
????sysbench --test=mutex --num-threads=16 --mutex-num=2048
????--mutex-locks=1000000 --mutex-loops=5000 run
?????????????£?

 

Number of threads: 16
Doing mutex performance test
Threads started!
Done.
Test execution summary:
total time: 3.6123s
total number of events: 16
total time taken by event execution: 57.6636
per-request statistics:
min: 3580.79ms
avg: 3603.98ms
max: 3610.94ms
approx. 95 percentile: 10000000.00ms
Threads fairness:
events (avg/stddev): 1.0000/0.00
execution time (avg/stddev): 3.6040/0.01