CentOS 6.8 64bit にて確認

準備

yum install -y perl-DBD-MySQL
mysql> create database test;
cd /opt/mysql/sql-bench

sudo ./run-all-tests \
 --user=root \
 --socket=/var/run/mysqld/mysqld.sock \
 --password=hogehoge

今回は--user=rootを指定したが、データーベースtestの権限を持つアカウントを作って指定しても動作すると思う。

結果

Total Score CPU 環境
3225950 Core i3-3220T @ 2.80GHz CentOS6(kvm)
847029 Pentium N4200 @ 1.10GHz CentOS6(kvm)
Score(3225950)
$ sudo ./run-all-tests \
>  --user=root \
>  --socket=/var/run/mysqld/mysqld.sock
Benchmark DBD suite: 2.15
Date of test:        2018-01-13 16:24:09
Running tests on:    Linux 2.6.32-696.13.2.el6.x86_64 x86_64
Arguments:           --socket=/var/run/mysqld/mysqld.sock
Comments:
Limits from:
Server version:      MySQL 4.0.30 log
Optimization:        None
Hardware:

alter-table: Total time:  9 wallclock secs ( 0.03 usr  0.01 sys +  0.00 cusr  0.00 csys =  0.04 CPU)
ATIS: Total time:  3 wallclock secs ( 2.04 usr  0.07 sys +  0.00 cusr  0.00 csys =  2.11 CPU)
big-tables: Total time:  1 wallclock secs ( 0.81 usr  0.07 sys +  0.00 cusr  0.00 csys =  0.88 CPU)
connect: Total time: 41 wallclock secs (14.53 usr  3.48 sys +  0.00 cusr  0.00 csys = 18.01 CPU)
create: Total time: 825 wallclock secs ( 2.69 usr  0.50 sys +  0.00 cusr  0.00 csys =  3.19 CPU)
insert: Total time: 282 wallclock secs (119.49 usr 12.42 sys +  0.00 cusr  0.00 csys = 131.91 CPU)
select: Total time: 22 wallclock secs (11.45 usr  0.92 sys +  0.00 cusr  0.00 csys = 12.37 CPU)
transactions: Test skipped because the database doesn't support transactions
wisconsin: Total time:  3 wallclock secs ( 1.17 usr  0.22 sys +  0.00 cusr  0.00 csys =  1.39 CPU)

All 9 test executed successfully

Totals per operation:
Operation             seconds     usr     sys     cpu   tests
alter_table_add                        4.00    0.01    0.01    0.02     100
alter_table_drop                       4.00    0.00    0.00    0.00      91
connect                                3.00    1.90    0.22    2.12   10000
connect+select_1_row                   4.00    2.12    0.28    2.40   10000
connect+select_simple                  4.00    2.05    0.27    2.32   10000
count                                  2.00    0.02    0.01    0.03     100
count_distinct                         0.00    0.06    0.00    0.06    1000
count_distinct_2                       0.00    0.05    0.00    0.05    1000
count_distinct_big                     3.00    1.70    0.02    1.72     120
count_distinct_group                   0.00    0.23    0.01    0.24    1000
count_distinct_group_on_key            0.00    0.07    0.01    0.08    1000
count_distinct_group_on_key_parts      0.00    0.22    0.00    0.22    1000
count_distinct_key_prefix              0.00    0.05    0.01    0.06    1000
count_group_on_key_parts               1.00    0.22    0.01    0.23    1000
count_on_key                           5.00    2.42    0.27    2.69   50100
create+drop                          276.00    0.82    0.16    0.98   10000
create_MANY_tables                   273.00    0.67    0.09    0.76   10000
create_index                           1.00    0.00    0.00    0.00       8
create_key+drop                      272.00    0.86    0.16    1.02   10000
create_table                           1.00    0.00    0.00    0.00      31
delete_all_many_keys                   5.00    0.00    0.00    0.00       1
delete_big                             0.00    0.00    0.00    0.00       1
delete_big_many_keys                   5.00    0.00    0.00    0.00     128
delete_key                             0.00    0.14    0.04    0.18   10000
delete_range                           1.00    0.00    0.00    0.00      12
drop_index                             0.00    0.01    0.00    0.01       8
drop_table                             0.00    0.00    0.00    0.00      28
drop_table_when_MANY_tables            1.00    0.15    0.05    0.20   10000
insert                                17.00    4.54    1.69    6.23  350768
insert_duplicates                      5.00    1.60    0.48    2.08  100000
insert_key                            12.00    2.00    0.45    2.45  100000
insert_many_fields                     1.00    0.07    0.02    0.09    2000
insert_select_1_key                    0.00    0.00    0.00    0.00       1
insert_select_2_keys                   1.00    0.00    0.00    0.00       1
min_max                                1.00    0.01    0.00    0.01      60
min_max_on_key                         7.00    4.05    0.47    4.52   85000
multiple_value_insert                  0.00    0.08    0.00    0.08  100000
order_by_big                           5.00    4.98    0.06    5.04      10
order_by_big_key                       6.00    5.16    0.03    5.19      10
order_by_big_key2                      5.00    4.99    0.04    5.03      10
order_by_big_key_desc                  5.00    5.12    0.06    5.18      10
order_by_big_key_diff                  6.00    5.03    0.04    5.07      10
order_by_big_key_prefix                5.00    5.02    0.05    5.07      10
order_by_key2_diff                     0.00    0.45    0.00    0.45     500
order_by_key_prefix                    1.00    0.25    0.00    0.25     500
order_by_range                         0.00    0.25    0.01    0.26     500
outer_join                             1.00    0.00    0.00    0.00      10
outer_join_found                       0.00    0.00    0.00    0.00      10
outer_join_not_found                   0.00    0.00    0.00    0.00     500
outer_join_on_key                      0.00    0.00    0.00    0.00      10
select_1_row                           6.00    1.43    0.46    1.89  100000
select_1_row_cache                     3.00    1.00    0.40    1.40  100000
select_2_rows                          7.00    1.50    0.47    1.97  100000
select_big                             5.00    5.13    0.00    5.13      80
select_big_str                         2.00    0.79    0.14    0.93   10000
select_cache                           1.00    0.46    0.05    0.51   10000
select_cache2                          7.00    0.58    0.07    0.65   10000
select_column+column                   6.00    1.44    0.49    1.93  100000
select_diff_key                       10.00    0.08    0.01    0.09     500
select_distinct                        0.00    0.38    0.01    0.39     800
select_group                           0.00    0.29    0.01    0.30    2911
select_group_when_MANY_tables          3.00    0.18    0.04    0.22   10000
select_join                            0.00    0.11    0.00    0.11     100
select_key                            21.00   10.74    1.15   11.89  200000
select_key2                           21.00   10.67    1.26   11.93  200000
select_key2_return_key                22.00   10.41    1.23   11.64  200000
select_key2_return_prim               22.00   10.61    1.21   11.82  200000
select_key_prefix                     22.00   10.79    1.22   12.01  200000
select_key_prefix_join                 1.00    0.96    0.00    0.96     100
select_key_return_key                 21.00   10.54    1.29   11.83  200000
select_many_fields                     0.00    0.74    0.05    0.79    2000
select_range                           2.00    1.90    0.03    1.93     410
select_range_key2                      2.00    1.06    0.08    1.14   25010
select_range_prefix                    2.00    1.05    0.08    1.13   25010
select_simple                          3.00    1.17    0.38    1.55  100000
select_simple_cache                    3.00    1.13    0.37    1.50  100000
select_simple_join                     1.00    0.13    0.01    0.14     500
update_big                             4.00    0.00    0.00    0.00      10
update_of_key                         22.00    0.69    0.22    0.91   50000
update_of_key_big                      2.00    0.00    0.00    0.00     501
update_of_primary_key_many_keys        3.00    0.01    0.01    0.02     256
update_with_key                       15.00    3.84    1.29    5.13  300000
update_with_key_prefix                 5.00    2.05    0.55    2.60  100000
wisc_benchmark                         1.00    0.78    0.07    0.85     114
TOTALS                              1188.00  150.01   17.67  167.68 3225950

Pentium N4200 @ 1.10GHz

Score(847029)
$ sudo ./run-all-tests \
>  --user=root \
>  --socket=/var/run/mysqld/mysqld.sock
Benchmark DBD suite: 2.15
Date of test:        2018-01-13 16:16:43
Running tests on:    Linux 2.6.32-642.13.1.el6.x86_64 x86_64
Arguments:           --socket=/var/run/mysqld/mysqld.sock
Comments:            
Limits from:         
Server version:      MySQL 4.0.30 log
Optimization:        None
Hardware:            

alter-table: Total time: 39 wallclock secs ( 0.07 usr  0.01 sys +  0.00 cusr  0.00 csys =  0.08 CPU)
ATIS: Total time: 21 wallclock secs ( 4.19 usr  0.19 sys +  0.00 cusr  0.00 csys =  4.38 CPU)
big-tables: Total time:  5 wallclock secs ( 1.75 usr  0.28 sys +  0.00 cusr  0.00 csys =  2.03 CPU)
connect: Total time: 80 wallclock secs (32.42 usr  8.32 sys +  0.00 cusr  0.00 csys = 40.74 CPU)
create: Warning: Can't execute create.  Check the file 'output/create-mysql-Linux_2.6.32_642.13.1.el6.x86_64_x86_64'
Failed (output/create-mysql-Linux_2.6.32_642.13.1.el6.x86_64_x86_64)
insert: Warning: Can't execute insert.  Check the file 'output/insert-mysql-Linux_2.6.32_642.13.1.el6.x86_64_x86_64'
Failed (output/insert-mysql-Linux_2.6.32_642.13.1.el6.x86_64_x86_64)
select: Total time: 170 wallclock secs (25.92 usr  2.25 sys +  0.00 cusr  0.00 csys = 28.17 CPU)
transactions: Test skipped because the database doesn't support transactions
wisconsin: Total time:  4 wallclock secs ( 1.73 usr  0.41 sys +  0.00 cusr  0.00 csys =  2.14 CPU)

Of 9 tests, 2 tests didn't work

Totals per operation:
Operation             seconds     usr     sys     cpu   tests
alter_table_add                       16.00    0.02    0.00    0.02     100 
alter_table_drop                      17.00    0.02    0.00    0.02      91 
connect                                9.00    5.40    0.71    6.11   10000 
connect+select_1_row                  11.00    5.69    0.87    6.56   10000 
connect+select_simple                 10.00    5.56    0.84    6.40   10000 
count_distinct                         4.00    0.21    0.03    0.24    1000 
count_distinct_2                       7.00    0.26    0.03    0.29    1000 
count_distinct_big                     4.00    3.06    0.07    3.13     100 
count_distinct_group                  10.00    0.55    0.02    0.57    1000 
count_distinct_group_on_key            5.00    0.24    0.02    0.26    1000 
count_distinct_group_on_key_parts     11.00    0.55    0.04    0.59    1000 
count_distinct_key_prefix              3.00    0.17    0.02    0.19    1000 
count_group_on_key_parts               4.00    0.48    0.02    0.50    1000 
count_on_key                          42.00    6.12    0.69    6.81   50000 
create_index                           3.00    0.00    0.00    0.00       8 
create_table                           1.00    0.01    0.00    0.01      31 
delete_big                             0.00    0.00    0.00    0.00       1 
drop_index                             2.00    0.00    0.00    0.00       8 
drop_table                             0.00    0.00    0.00    0.00      28 
insert                                 6.00    1.42    0.50    1.92   50768 
insert_many_fields                     2.00    0.22    0.03    0.25    2000 
min_max_on_key                        25.00    7.06    0.79    7.85   70000 
select_1_row                           8.00    2.30    0.96    3.26  100000 
select_1_row_cache                     7.00    2.15    0.96    3.11  100000 
select_2_rows                          9.00    2.39    0.94    3.33  100000 
select_big                             0.00    0.06    0.00    0.06      70 
select_big_str                         5.00    2.55    0.38    2.93   10000 
select_cache                          13.00    1.65    0.14    1.79   10000 
select_cache2                         14.00    1.79    0.18    1.97   10000 
select_column+column                   8.00    2.32    0.96    3.28  100000 
select_distinct                        5.00    0.74    0.02    0.76     800 
select_group                           6.00    0.79    0.04    0.83    2800 
select_join                            1.00    0.20    0.01    0.21     100 
select_key_prefix_join                 5.00    1.71    0.01    1.72     100 
select_many_fields                     3.00    1.53    0.25    1.78    2000 
select_range                          27.00    3.45    0.11    3.56     410 
select_simple                          6.00    2.04    0.87    2.91  100000 
select_simple_cache                    6.00    2.02    0.83    2.85  100000 
select_simple_join                     1.00    0.28    0.00    0.28     500 
wisc_benchmark                         1.00    1.03    0.11    1.14     114 
TOTALS                               317.00   66.04   11.45   77.49  847029 

ubuntu 17.10では動かなかった

  • libdbd-mysql-perlがmysql4.0に対応していないため。
wget https://github.com/tukiyo/mysql4.0php5.2/releases/download/ubuntu1704/opt-mysql4_4.0.30-1_amd64.17.04.deb

sudo dpkg -i opt-mysql4_4.0.30-1_amd64.17.04.deb

cd /opt/mysql/bin
$ sudo ./mysql_install_db
Preparing db table
Preparing host table
Preparing user table
Preparing func table
Preparing tables_priv table
Preparing columns_priv table
Installing all prepared tables
180113 16:33:20 /opt/mysql/libexec/mysqld: Shutdown Complete


To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/opt/mysql/bin/mysqladmin -u root password 'new-password'
/opt/mysql/bin/mysqladmin -u root -h nx1 password 'new-password'
See the manual for more instructions.

You can start the MySQL daemon with:
cd /opt/mysql ; /opt/mysql/bin/mysqld_safe &

You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests

Please report any problems with the /opt/mysql/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
mysqld起動
chown -R mysql:mysql /opt/mysql/var/

cd /opt/mysql
sudo /opt/mysql/bin/mysqld_safe &
perlでmysqlに接続できるように
sudo apt install -y libdbd-mysql-perl
ベンチマーク測定
cd /opt/mysql/sql-bench
エラー
sudo ./run-all-tests \
 --user=root \
 --socket=/tmp/mysql.sock

Got error: 'Malformed packet' when connecting to DBI:mysql:database=test;host=localhost;mysql_socket=/tmp/mysql.sock with user: 'root' password: ''

libdbd-mysql-perlがmysql 4.0に対応していない様子。
自前でmysql4.0のライブラリを指定してリビルドすれば動くと思う。

Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account log in.