CPU性能测试
[root@kiwi bin]# ./sysbench --test=cpu --cpu-max-prime=20000 run
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
Doing CPU performance benchmark
Threads started!
Done.
Maximum prime number checked in CPU test: 20000
Test execution summary:
total time: 26.8641s
total number of events: 10000
total time taken by event execution: 26.8619
per-request statistics:
min: 2.60ms
avg: 2.69ms
max: 5.95ms
approx. 95 percentile: 2.73ms
Threads fairness:
events (avg/stddev): 10000.0000/0.00
execution time (avg/stddev): 26.8619/0.00
线程测试
[root@kiwi bin]# ./sysbench --test=threads --num-threads=64 --thread-yields=100--thread-locks=2 run
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 64
Doing thread subsystem performance test
Thread yields per test: 100 Locks used: 8
Threads started!
Done.
Test execution summary:
total time: 0.5293s
total number of events: 10000
total time taken by event execution: 32.7757
per-request statistics:
min: 0.03ms
avg: 3.28ms
max: 89.10ms
approx. 95 percentile: 11.62ms
Threads fairness:
events (avg/stddev): 156.2500/16.87
execution time (avg/stddev): 0.5121/0.02
I/O性能测试
[root@kiwi bin]# ./sysbench --test=fileio --num-threads=16 --file-total-size=3G --file-test-mode=rndrw prepare
sysbench 0.4.12: multi-threaded system evaluation benchmark
128 files, 24576Kb each, 3072Mb total
Creating files for the test...
[root@kiwi bin]# ./sysbench --test=fileio --num-threads=16 --file-total-size=3G --file-test-mode=rndrw run
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 16
Extra file open flags: 0
128 files, 24Mb each
3Gb total file size
Block size 16Kb
Number of random requests for random IO: 10000
Read/Write ratio for combined random IO test: 1.50
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random r/w test
Threads started!
Done.
Operations performed: 6005 Read, 3996 Write, 12800 Other = 22801 Total
Read 93.828Mb Written 62.438Mb Total transferred 156.27Mb (97.645Mb/sec)
6249.28 Requests/sec executed
Test execution summary:
total time: 1.6003s
total number of events: 10001
total time taken by event execution: 10.1155
per-request statistics:
min: 0.00ms
avg: 1.01ms
max: 162.43ms
approx. 95 percentile: 3.23ms
Threads fairness:
events (avg/stddev): 625.0625/33.76
execution time (avg/stddev): 0.6322/0.02
Mutex测试:
[root@kiwi bin]# ./sysbench --test=mutex --num-threads=16 --mutex-num=1024--mutex-locks=10000 --mutex-loops=5000 run
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 16
Doing mutex performance test
Threads started!
Done.
Test execution summary:
total time: 0.1034s
total number of events: 16
total time taken by event execution: 1.3305
per-request statistics:
min: 33.05ms
avg: 83.16ms
max: 101.41ms
approx. 95 percentile: 101.39ms
Threads fairness:
events (avg/stddev): 1.0000/0.00
execution time (avg/stddev): 0.0832/0.02
数据库性能测试
[root@kiwi bin]# ./sysbench --test=oltp --mysql-table-engine=innodb --oltp-table-size=1000000 --mysql-user=root --mysql-host=127.0.0.1 --mysql-socket=/var/lib/mysql/mysql.sock --mysql-password=mysql --db-driver=mysql prepare
sysbench 0.4.12: multi-threaded system evaluation benchmark
Creating table 'sbtest'...
Creating 1000000 records in table 'sbtest'...
[root@kiwi bin]# ./sysbench --mysql-db=sbtest --max-requests=0 --test=oltp --mysql-engine-trx=yes --mysql-table-engine=innodb --oltp-table-size=1000000 --db-ps-mode=disable --mysql-user=root --mysql-host=127.0.0.1 --mysql-socket=/var/lib/mysql/mysql.sock --mysql-password=mysql --num-threads=16 --max-time=600 run
sysbench 0.4.12: multi-threaded system evaluation benchmark
No DB drivers specified, using mysql
Running the test with following options:
Number of threads: 16
Doing OLTP test.
Running mixed OLTP test
Using Special distribution (12 iterations, 1 pct of values are returned in 75 pct cases)
Using "BEGIN" for starting transactions
Using auto_inc on the id column
Threads started!
Time limit exceeded, exiting...
(last message repeated 15 times)
Done.
OLTP test statistics:
queries performed:
read: 4186266
write: 1495095
other: 598038
total: 6279399
transactions: 299019 (498.36 per sec.)
deadlocks: 0 (0.00 per sec.)
read/write requests: 5681361 (9468.83 per sec.)
other operations: 598038 (996.72 per sec.)
Test execution summary:
total time: 600.0065s
total number of events: 299019
total time taken by event execution: 9598.5851
per-request statistics:
min: 4.14ms
avg: 32.10ms
max: 465.93ms
approx. 95 percentile: 54.55ms
Threads fairness:
events (avg/stddev): 18688.6875/285.35
execution time (avg/stddev): 599.9116/0.00
mysql 压力测试
最新推荐文章于 2023-08-12 16:04:00 发布