root@keket:~# apt-get install sysbench
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
sysbench
0 upgraded, 1 newly installed, 0 to remove and 22 not upgraded.
Need to get 56.7 kB of archives.
After this operation, 170 kB of additional disk space will be used.
Get:1 http://kambing.ui.ac.id/ubuntu/ trusty/universe sysbench amd64 0.4.12-1.1 [56.7 kB]
Fetched 56.7 kB in 0s (131 kB/s)
Selecting previously unselected package sysbench.
(Reading database ... 159273 files and directories currently installed.)
Preparing to unpack .../sysbench_0.4.12-1.1_amd64.deb ...
Unpacking sysbench (0.4.12-1.1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up sysbench (0.4.12-1.1) ...
root@keket:~# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 551
Server version: 5.5.49-0ubuntu0.14.04.1-log (Ubuntu)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| keket |
| keket_web |
| kucinglucu |
| mysql |
| ora |
| paradisea |
| performance_schema |
| puskomedia_id |
| tukangtamanjakarta |
+--------------------+
10 rows in set (0.01 sec)
mysql> create database test;
Query OK, 1 row affected (0.00 sec)
mysql> quit;
Bye
root@keket:~# sysbench --test=oltp --oltp-table-size=1000000 --mysql-db=test --mysql-user=root --mysql-password=hahahaahah prepare
sysbench 0.4.12: multi-threaded system evaluation benchmark
No DB drivers specified, using mysql
Creating table 'sbtest'...
Creating 1000000 records in table 'sbtest'...
root@keket:~# sysbench --test=oltp --oltp-table-size=1000000 --mysql-db=test --mysql-user=root --mysql-password=hahahahaa --max-time=60 --oltp-read-only=on --max-request=0 --num-threads=8 run
Unknown option: --max-request.
Usage:
sysbench [general-options]... --test=<test-name> [test-options]... command
General options:
--num-threads=N number of threads to use [1]
--max-requests=N limit for total number of requests [10000]
--max-time=N limit for total execution time in seconds [0]
--forced-shutdown=STRING amount of time to wait after --max-time before forcing shutdown [off]
--thread-stack-size=SIZE size of stack per thread [32K]
--init-rng=[on|off] initialize random number generator [off]
--test=STRING test to run
--debug=[on|off] print more debugging info [off]
--validate=[on|off] perform validation checks where possible [off]
--help=[on|off] print help and exit
--version=[on|off] print version and exit
Compiled-in tests:
fileio - File I/O test
cpu - CPU performance test
memory - Memory functions speed test
threads - Threads subsystem performance test
mutex - Mutex performance test
oltp - OLTP test
Commands: prepare run cleanup help version
See 'sysbench --test=<name> help' for a list of options for each test.
root@keket:~# sysbench --test=oltp --oltp-table-size=1000000 --mysql-db=test --mysql-user=root --mysql-password=hahahahaha --max-time=60 --oltp-read-only=on --max-requests=0 --num-threads=8 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: 8
Doing OLTP test.
Running mixed OLTP test
Doing read-only test
Using Special distribution (12 iterations, 1 pct of values are returned in 75 pct cases)
Using "LOCK TABLES READ" for starting transactions
Using auto_inc on the id column
Threads started!
Time limit exceeded, exiting...
(last message repeated 7 times)
Done.
OLTP test statistics:
queries performed:
read: 399476
write: 0
other: 57068
total: 456544
transactions: 28534 (475.51 per sec.)
deadlocks: 0 (0.00 per sec.)
read/write requests: 399476 (6657.19 per sec.)
other operations: 57068 (951.03 per sec.)
Test execution summary:
total time: 60.0067s
total number of events: 28534
total time taken by event execution: 479.8726
per-request statistics:
min: 5.45ms
avg: 16.82ms
max: 54.32ms
approx. 95 percentile: 23.95ms
Threads fairness:
events (avg/stddev): 3566.7500/37.25
execution time (avg/stddev): 59.9841/0.00
root@keket:~#