こんにちわ、デプロイ王子こと廣瀬 一海(@kazumihirose)です。
- 背景
- 目的
- 検証環境について
- TCP-Cについて
- ベンチマーク結果
- コネクション時の通信帯域
- MySQLサーバーのパラメーターの差異に関して
- 資料:セッティングパラメーター
- sysbench-lua 0.5について
- ベンチマーク結果
背景
RDBMSにおけるOLTP処理において、Fusion-io社のioDrive2はゲームなどを中心に非常に高い性能を示しており、各RDBMSのストレージとして採用されています。この事から、ioDrive2に匹敵する性能をクラウド求にられていくことが予想されます。
目的
本検証はハイブリッドクラウド環境において、ioDrive2搭載サーバの実運用性を検証することを目的としています。
EquinixにioDrive2を搭載した物理サーバを設置し、AmazonVPC内から、Amazon Direct Connectを経由して各種ベンチマークを行い、その性能と実運用性を検証を行います。
検証環境について
検証環境は以下の図の通りです。
Amazon VPCの1つのサブネットに、ベンチマーク用インスタンスとAmazon RDSのインスタンスを起動しています。また、Equinixデータセンターには物理サーバが設置されており、このサーバまでは本VPC及びDirectConnectを介して、互いに疎通しています。
各検証機のスペックは以下の表を参考にしてください。
Benchmark クライアント インスタンス
Name | Value |
---|---|
Instance Type | r3.8xlarge |
CPU | 32 vCPU |
Memory | 244GB |
Storage | 320GB x 2 |
Network | 10GBps |
Amazon RDS ターゲット インスタンス
Name | Value |
---|---|
DB Version | MySQL 5.6.17 |
Instance Type | db.r3.8xlarge |
Storage | 3072GB |
IOPS | 25000 |
Replication | Multi AZ |
Equinix FusionIO搭載 物理サーバー
Name | Value |
---|---|
DB Version | MySQL 5.6.17 |
CPU | Intel(R) Xeon(R) CPU E5-2697 v2 @ 2.70GHz () cache 30720KB family 6 model 62 stepping 4 48core |
Memory | 32GB |
Storage | OS /dev/sda 146.7GB ext4 |
Other Storage | ioDrive2 /dev/fioa1 365.000 GB XFS sector format 4Kbyte |
TPC-Cについて
TPC-CはTPCによって策定されたベンチマーク仕様の一つで、過去のTPC-A/TPC-Bの改良ベンチマークにあたります。このベンチマークでは卸売業の業務を参考モデルとしており、注文・支払いなどのトランザクションを実行し、システムの性能を測定します。
データはwarehouseを500をデーターセットとしてあらかじめ準備しました。
参考指標としてwarehouseは数値が多いほどスケールファクターとして扱われます、またクライアントからコネクションにより並列度が決定されます。
ioDrive2および、RDSのインスタンスに対し、以下の組み合わせのベンチマークを行いました。
ベンチマーク組み合わせ
ioDrive および RDSそれぞれ以下の組み合わせで行いました。
warehouse | connection |
---|---|
100 | 50 |
100 | 100 |
100 | 200 |
250 | 50 |
250 | 100 |
250 | 200 |
500 | 50 |
500 | 100 |
500 | 200 |
ベンチマーク結果
低コネクションレートでは、時折RDSがioDriveがピークで超えることがありますが、概ねioDrive2の方がトランザクション性能面ではRDSよりも良いという結果が出ています。
ioDrive2では意図的にクエリキャッシュを切っています。よって、RDSにクエリキャッシュが搭載されている影響である可能性が高いと推察しています
w100-c50
w100-c100
w100-c200
w250-c50
w250-c100
w250-c200
w500-c50
w500-c100
w500-c200
コネクション時の通信帯域
ベンチマーク時に計測したDX端点のルーターの帯域グラフを以下に掲載します。
C50時
C100時
C250時
MySQLサーバーのパラメーターの差異に関して
RDSとioDrive2におけるパラメータの差異のみを記載します。
(※表が大きいため、文字を小さくして全体を表示しています。詳細は、元記事をご参考いただければ幸いです。)
Variable_name | RDS value | ioDrive2 value |
---|---|---|
basedir | /rdsdbbin/mysql/ | /usr |
character_set_database | latin1 | utf8 |
character_set_server | latin1 | utf8 |
character_sets_dir | /rdsdbbin/mysql-5.6.17.R1/share/charsets/ | /usr/share/mysql/charsets/ |
collation_database | latin1_swedish_ci | utf8_general_ci |
collation_server | latin1_swedish_ci | utf8_general_ci |
datadir | /rdsdbdata/db/ | /var/lib/mysql/ |
expire_logs_days | 0 | 14 |
explicit_defaults_for_timestamp | ON | OFF |
general_log_file | /rdsdbdata/log/general/mysql-general.log | /var/lib/mysql/localhost.log |
have_openssl | YES | DISABLED |
have_ssl | YES | DISABLED |
hostname | ip-172-23-0-137 | localhost.localdomain |
innodb_buffer_pool_size | 193115193344 | 26843545600 |
innodb_data_file_path | ibdata1:12M:autoextend | ibdata1:10M:autoextend |
innodb_data_home_dir | /rdsdbdata/db/innodb | /var/lib/mysql |
innodb_file_format | Antelope | Barracuda |
innodb_large_prefix | OFF | ON |
innodb_lock_wait_timeout | 50 | 120 |
innodb_log_buffer_size | 8388608 | 16777216 |
innodb_log_group_home_dir | /rdsdbdata/log/innodb | ./ |
innodb_open_files | 2000 | 4096 |
innodb_print_all_deadlocks | OFF | ON |
innodb_read_io_threads | 4 | 16 |
innodb_strict_mode | OFF | ON |
innodb_write_io_threads | 4 | 16 |
key_buffer_size | 16777216 | 33554432 |
lc_messages_dir | /rdsdbbin/mysql-5.6.17.R1/share/ | /usr/share/mysql/ |
log_bin | OFF | ON |
log_bin_basename | /var/lib/mysql/mysql-bin | |
log_bin_index | /var/lib/mysql/mysql-bin.index | |
log_error | /rdsdbdata/log/error/mysql-error.log | /var/lib/mysql/mysql-error.log |
log_output | TABLE | FILE |
log_queries_not_using_indexes | OFF | ON |
log_slave_updates | ON | OFF |
master_info_repository | TABLE | FILE |
max_allowed_packet | 4194304 | 16777216 |
max_binlog_size | 134217728 | 1073741824 |
max_connect_errors | 100 | 1000000 |
max_heap_table_size | 16777216 | 67108864 |
myisam_recover_options | OFF | BACKUP,FORCE |
open_files_limit | 65535 | 102315 |
performance_schema | OFF | ON |
performance_schema_accounts_size | -1 | 100 |
performance_schema_digests_size | -1 | 10000 |
performance_schema_events_stages_history_long_size | -1 | 10000 |
performance_schema_events_stages_history_size | -1 | 10 |
performance_schema_events_statements_history_long_size | -1 | 10000 |
performance_schema_events_statements_history_size | -1 | 10 |
performance_schema_events_waits_history_long_size | -1 | 10000 |
performance_schema_events_waits_history_size | -1 | 10 |
performance_schema_hosts_size | -1 | 100 |
performance_schema_max_cond_instances | -1 | 90144 |
performance_schema_max_file_instances | -1 | 157408 |
performance_schema_max_mutex_instances | -1 | 164738 |
performance_schema_max_rwlock_instances | -1 | 65902 |
performance_schema_max_socket_instances | -1 | 40946 |
performance_schema_max_table_handles | -1 | 8192 |
performance_schema_max_table_instances | -1 | 12500 |
performance_schema_max_thread_instances | -1 | 41026 |
performance_schema_session_connect_attrs_size | -1 | 512 |
performance_schema_users_size | -1 | 100 |
pid_file | /rdsdbdata/log/mysql-3306.pid | /var/lib/mysql/mysql.pid |
plugin_dir | /rdsdbbin/mysql-5.6.17.R1/lib/plugin/ | /usr/lib64/mysql/plugin/ |
pseudo_thread_id | 1680 | 3193 |
query_cache_size | 1048576 | 0 |
read_buffer_size | 262144 | 131072 |
read_rnd_buffer_size | 524288 | 262144 |
relay_log | /rdsdbdata/log/relaylog/relaylog | |
relay_log_basename | /rdsdbdata/log/relaylog/relaylog | |
relay_log_index | /rdsdbdata/log/relaylog/relaylog.index | |
relay_log_info_repository | TABLE | FILE |
relay_log_recovery | ON | OFF |
secure_file_priv | /tmp/ | |
server_id | 1875561690 | 1 |
server_uuid | 0ba6f778-0118-11e4-8f53-066a99301f11 | 3996a66b-06ae-11e4-b3c1-a0d3c104d7d4 |
slave_load_tmpdir | /rdsdbdata/tmp | /tmp |
slow_query_log | OFF | ON |
slow_query_log_file | /rdsdbdata/log/slowquery/mysql-slowquery.log | /var/lib/mysql/mysql-slow.log |
socket | /tmp/mysql.sock | /var/lib/mysql/mysql.sock |
ssl_ca | /rdsdbdata/rds-metadata/ca-cert.pem | |
ssl_cert | /rdsdbdata/rds-metadata/server-cert.pem | |
ssl_cipher | EXP1024-RC4-SHA:… | |
ssl_key | /rdsdbdata/rds-metadata/server-key.pem | |
system_time_zone | UTC | JST |
table_definition_cache | 1400 | 4096 |
table_open_cache | 2000 | 4096 |
table_open_cache_instances | 16 | 1 |
thread_cache_size | 100 | 256 |
time_zone | UTC | SYSTEM |
timestamp | 1404719791.828739 | 1405077097.750732 |
tmp_table_size | 16777216 | 67108864 |
tmpdir | /rdsdbdata/tmp | /tmp |
version | 5.6.17 | 5.6.17-log |
資料:セッティングパラメーター
すべてのセッティングにかかわるパラメーターを以下に記載します。
(※表が大きいため、文字を小さくして全体を表示しています。詳細は、元記事をご参考いただければ幸いです。)
設定 | MySQLDefault | AmazonRDS | FusionIO |
---|---|---|---|
auto_increment_increment | 1 | 1 | 1 |
auto_increment_offset | 1 | 1 | 1 |
autocommit | ON | ON | ON |
automatic_sp_privileges | ON | ON | ON |
back_log | 80 | 900 | 900 |
basedir | /usr | /rdsdbbin/mysql/ | /usr |
big_tables | OFF | OFF | OFF |
bind_address | * | * | * |
binlog_cache_size | 32768 | 32768 | 32768 |
binlog_checksum | CRC32 | CRC32 | CRC32 |
binlog_direct_non_transactional_updates | OFF | OFF | OFF |
binlog_format | STATEMENT | STATEMENT | STATEMENT |
binlog_max_flush_queue_time | 0 | 0 | 0 |
binlog_order_commits | ON | ON | ON |
binlog_row_image | FULL | FULL | FULL |
binlog_rows_query_log_events | OFF | OFF | OFF |
binlog_stmt_cache_size | 32768 | 32768 | 32768 |
block_encryption_mode | aes-128-ecb | aes-128-ecb | aes-128-ecb |
bulk_insert_buffer_size | 8388608 | 8388608 | 8388608 |
character_set_client | utf8 | utf8 | utf8 |
character_set_connection | utf8 | utf8 | utf8 |
character_set_database | latin1 | latin1 | utf8 |
character_set_filesystem | binary | binary | binary |
character_set_results | utf8 | utf8 | utf8 |
character_set_server | latin1 | latin1 | utf8 |
character_set_system | utf8 | utf8 | utf8 |
character_sets_dir | /usr/share/mysql/charsets/ | /rdsdbbin/mysql-5.6.17.R1/share/charsets/ | /usr/share/mysql/charsets/ |
collation_connection | utf8_general_ci | utf8_general_ci | utf8_general_ci |
collation_database | latin1_swedish_ci | latin1_swedish_ci | utf8_general_ci |
collation_server | latin1_swedish_ci | latin1_swedish_ci | utf8_general_ci |
completion_type | NO_CHAIN | NO_CHAIN | NO_CHAIN |
concurrent_insert | AUTO | AUTO | AUTO |
connect_timeout | 10 | 10 | 10 |
core_file | OFF | OFF | OFF |
datadir | /var/lib/mysql/ | /rdsdbdata/db/ | /var/lib/mysql/ |
date_format | %Y-%m-%d | %Y-%m-%d | %Y-%m-%d |
datetime_format | %Y-%m-%d %H:%i:%s | %Y-%m-%d %H:%i:%s | %Y-%m-%d %H:%i:%s |
default_storage_engine | InnoDB | InnoDB | InnoDB |
default_tmp_storage_engine | InnoDB | InnoDB | InnoDB |
default_week_format | 0 | 0 | 0 |
delay_key_write | ON | ON | ON |
delayed_insert_limit | 100 | 100 | 100 |
delayed_insert_timeout | 300 | 300 | 300 |
delayed_queue_size | 1000 | 1000 | 1000 |
disconnect_on_expired_password | ON | ON | ON |
div_precision_increment | 4 | 4 | 4 |
end_markers_in_json | OFF | OFF | OFF |
enforce_gtid_consistency | OFF | OFF | OFF |
eq_range_index_dive_limit | 10 | 10 | 10 |
error_count | 0 | 0 | 0 |
event_scheduler | OFF | OFF | OFF |
expire_logs_days | 0 | 0 | 14 |
explicit_defaults_for_timestamp | OFF | ON | OFF |
external_user | |||
flush | OFF | OFF | OFF |
flush_time | 0 | 0 | 0 |
foreign_key_checks | ON | ON | ON |
ft_boolean_syntax | + … | + … | + … | |
ft_max_word_len | 84 | 84 | 84 |
ft_min_word_len | 4 | 4 | 4 |
ft_query_expansion_limit | 20 | 20 | 20 |
ft_stopword_file | (built-in) | (built-in) | (built-in) |
general_log | OFF | OFF | OFF |
general_log_file | /var/lib/mysql/localhost.log | /rdsdbdata/log/general/mysql-general.log | /var/lib/mysql/localhost.log |
group_concat_max_len | 1024 | 1024 | 1024 |
gtid_executed | |||
gtid_mode | OFF | OFF | OFF |
gtid_next | AUTOMATIC | AUTOMATIC | AUTOMATIC |
gtid_owned | |||
gtid_purged | |||
have_compress | YES | YES | YES |
have_crypt | YES | YES | YES |
have_dynamic_loading | YES | YES | YES |
have_geometry | YES | YES | YES |
have_openssl | DISABLED | YES | DISABLED |
have_profiling | YES | YES | YES |
have_query_cache | YES | YES | YES |
have_rtree_keys | YES | YES | YES |
have_ssl | DISABLED | YES | DISABLED |
have_symlink | YES | YES | YES |
host_cache_size | 279 | 1626 | 1626 |
hostname | localhost.localdomain | ip-172-23-0-137 | localhost.localdomain |
identity | 0 | 0 | 0 |
ignore_builtin_innodb | OFF | OFF | OFF |
ignore_db_dirs | |||
init_connect | |||
init_file | |||
init_slave | |||
innodb_adaptive_flushing | ON | ON | ON |
innodb_adaptive_flushing_lwm | 10 | 10 | 10 |
innodb_adaptive_hash_index | ON | ON | ON |
innodb_adaptive_max_sleep_delay | 150000 | 150000 | 150000 |
innodb_additional_mem_pool_size | 8388608 | 8388608 | 8388608 |
innodb_api_bk_commit_interval | 5 | 5 | 5 |
innodb_api_disable_rowlock | OFF | OFF | OFF |
innodb_api_enable_binlog | OFF | OFF | OFF |
innodb_api_enable_mdl | OFF | OFF | OFF |
innodb_api_trx_level | 0 | 0 | 0 |
innodb_autoextend_increment | 64 | 64 | 64 |
innodb_autoinc_lock_mode | 1 | 1 | 1 |
innodb_buffer_pool_dump_at_shutdown | OFF | OFF | OFF |
innodb_buffer_pool_dump_now | OFF | OFF | OFF |
innodb_buffer_pool_filename | ib_buffer_pool | ib_buffer_pool | ib_buffer_pool |
innodb_buffer_pool_instances | 8 | 8 | 8 |
innodb_buffer_pool_load_abort | OFF | OFF | OFF |
innodb_buffer_pool_load_at_startup | OFF | OFF | OFF |
innodb_buffer_pool_load_now | OFF | OFF | OFF |
innodb_buffer_pool_size | 134217728 | 193115193344 | 26843545600 |
innodb_change_buffer_max_size | 25 | 25 | 25 |
innodb_change_buffering | all | all | all |
innodb_checksum_algorithm | innodb | innodb | innodb |
innodb_checksums | ON | ON | ON |
innodb_cmp_per_index_enabled | OFF | OFF | OFF |
innodb_commit_concurrency | 0 | 0 | 0 |
innodb_compression_failure_threshold_pct | 5 | 5 | 5 |
innodb_compression_level | 6 | 6 | 6 |
innodb_compression_pad_pct_max | 50 | 50 | 50 |
innodb_concurrency_tickets | 5000 | 5000 | 5000 |
innodb_data_file_path | ibdata1:12M:autoextend | ibdata1:12M:autoextend | ibdata1:10M:autoextend |
innodb_data_home_dir | /rdsdbdata/db/innodb | /var/lib/mysql | |
innodb_disable_sort_file_cache | OFF | OFF | OFF |
innodb_doublewrite | ON | ON | ON |
innodb_fast_shutdown | 1 | 1 | 1 |
innodb_file_format | Antelope | Antelope | Barracuda |
innodb_file_format_check | ON | ON | ON |
innodb_file_format_max | Antelope | Antelope | Antelope |
innodb_file_per_table | ON | ON | ON |
innodb_flush_log_at_timeout | 1 | 1 | 1 |
innodb_flush_log_at_trx_commit | 1 | 1 | 1 |
innodb_flush_method | O_DIRECT | O_DIRECT | |
innodb_flush_neighbors | 1 | 1 | 1 |
innodb_flushing_avg_loops | 30 | 30 | 30 |
innodb_force_load_corrupted | OFF | OFF | OFF |
innodb_force_recovery | 0 | 0 | 0 |
innodb_ft_aux_table | |||
innodb_ft_cache_size | 8000000 | 8000000 | 8000000 |
innodb_ft_enable_diag_print | OFF | OFF | OFF |
innodb_ft_enable_stopword | ON | ON | ON |
innodb_ft_max_token_size | 84 | 84 | 84 |
innodb_ft_min_token_size | 3 | 3 | 3 |
innodb_ft_num_word_optimize | 2000 | 2000 | 2000 |
innodb_ft_result_cache_limit | 2000000000 | 2000000000 | 2000000000 |
innodb_ft_server_stopword_table | |||
innodb_ft_sort_pll_degree | 2 | 2 | 2 |
innodb_ft_total_cache_size | 640000000 | 640000000 | 640000000 |
innodb_ft_user_stopword_table | |||
innodb_io_capacity | 200 | 200 | 200 |
innodb_io_capacity_max | 2000 | 2000 | 2000 |
innodb_large_prefix | OFF | OFF | ON |
innodb_lock_wait_timeout | 50 | 50 | 120 |
innodb_locks_unsafe_for_binlog | OFF | OFF | OFF |
innodb_log_buffer_size | 8388608 | 8388608 | 16777216 |
innodb_log_compressed_pages | ON | ON | ON |
innodb_log_file_size | 50331648 | 134217728 | 134217728 |
innodb_log_files_in_group | 2 | 2 | 2 |
innodb_log_group_home_dir | ./ | /rdsdbdata/log/innodb | ./ |
innodb_lru_scan_depth | 1024 | 1024 | 1024 |
innodb_max_dirty_pages_pct | 75 | 75 | 75 |
innodb_max_dirty_pages_pct_lwm | 0 | 0 | 0 |
innodb_max_purge_lag | 0 | 0 | 0 |
innodb_max_purge_lag_delay | 0 | 0 | 0 |
innodb_mirrored_log_groups | 1 | 1 | 1 |
innodb_monitor_disable | |||
innodb_monitor_enable | |||
innodb_monitor_reset | |||
innodb_monitor_reset_all | |||
innodb_old_blocks_pct | 37 | 37 | 37 |
innodb_old_blocks_time | 1000 | 1000 | 1000 |
innodb_online_alter_log_max_size | 134217728 | 134217728 | 134217728 |
innodb_open_files | 2000 | 2000 | 4096 |
innodb_optimize_fulltext_only | OFF | OFF | OFF |
innodb_page_size | 16384 | 16384 | 16384 |
innodb_print_all_deadlocks | OFF | OFF | ON |
innodb_purge_batch_size | 300 | 300 | 300 |
innodb_purge_threads | 1 | 1 | 1 |
innodb_random_read_ahead | OFF | OFF | OFF |
innodb_read_ahead_threshold | 56 | 56 | 56 |
innodb_read_io_threads | 4 | 4 | 16 |
innodb_read_only | OFF | OFF | OFF |
innodb_replication_delay | 0 | 0 | 0 |
innodb_rollback_on_timeout | OFF | OFF | OFF |
innodb_rollback_segments | 128 | 128 | 128 |
innodb_sort_buffer_size | 1048576 | 1048576 | 1048576 |
innodb_spin_wait_delay | 6 | 6 | 6 |
innodb_stats_auto_recalc | ON | ON | ON |
innodb_stats_method | nulls_equal | nulls_equal | nulls_equal |
innodb_stats_on_metadata | OFF | OFF | OFF |
innodb_stats_persistent | ON | ON | ON |
innodb_stats_persistent_sample_pages | 20 | 20 | 20 |
innodb_stats_sample_pages | 8 | 8 | 8 |
innodb_stats_transient_sample_pages | 8 | 8 | 8 |
innodb_status_output | OFF | OFF | OFF |
innodb_status_output_locks | OFF | OFF | OFF |
innodb_strict_mode | OFF | OFF | ON |
innodb_support_xa | ON | ON | ON |
innodb_sync_array_size | 1 | 1 | 1 |
innodb_sync_spin_loops | 30 | 30 | 30 |
innodb_table_locks | ON | ON | ON |
innodb_thread_concurrency | 0 | 0 | 0 |
innodb_thread_sleep_delay | 10000 | 10000 | 10000 |
innodb_undo_directory | . | . | . |
innodb_undo_logs | 128 | 128 | 128 |
innodb_undo_tablespaces | 0 | 0 | 0 |
innodb_use_native_aio | ON | ON | ON |
innodb_use_sys_malloc | ON | ON | ON |
innodb_version | 5.6.17 | 5.6.17 | 5.6.17 |
innodb_write_io_threads | 4 | 4 | 16 |
insert_id | 0 | 0 | 0 |
interactive_timeout | 28800 | 28800 | 28800 |
join_buffer_size | 262144 | 262144 | 262144 |
keep_files_on_create | OFF | OFF | OFF |
key_buffer_size | 8388608 | 16777216 | 33554432 |
key_cache_age_threshold | 300 | 300 | 300 |
key_cache_block_size | 1024 | 1024 | 1024 |
key_cache_division_limit | 100 | 100 | 100 |
large_files_support | ON | ON | ON |
large_page_size | 0 | 0 | 0 |
large_pages | OFF | OFF | OFF |
last_insert_id | 0 | 0 | 0 |
lc_messages | en_US | en_US | en_US |
lc_messages_dir | /usr/share/mysql/ | /rdsdbbin/mysql-5.6.17.R1/share/ | /usr/share/mysql/ |
lc_time_names | en_US | en_US | en_US |
license | GPL | GPL | GPL |
local_infile | ON | ON | ON |
lock_wait_timeout | 31536000 | 31536000 | 31536000 |
locked_in_memory | OFF | OFF | OFF |
log_bin | OFF | OFF | ON |
log_bin_basename | /var/lib/mysql/mysql-bin | ||
log_bin_index | /var/lib/mysql/mysql-bin.index | ||
log_bin_trust_function_creators | OFF | OFF | OFF |
log_bin_use_v1_row_events | OFF | OFF | OFF |
log_error | /var/lib/mysql/localhost.localdomain.err | /rdsdbdata/log/error/mysql-error.log | /var/lib/mysql/mysql-error.log |
log_output | FILE | TABLE | FILE |
log_queries_not_using_indexes | OFF | OFF | ON |
log_slave_updates | OFF | ON | OFF |
log_slow_admin_statements | OFF | OFF | OFF |
log_slow_slave_statements | OFF | OFF | OFF |
log_throttle_queries_not_using_indexes | 0 | 0 | 0 |
log_warnings | 1 | 1 | 1 |
long_query_time | 10.000000 | 10.000000 | 10.000000 |
low_priority_updates | OFF | OFF | OFF |
lower_case_file_system | OFF | OFF | OFF |
lower_case_table_names | 0 | 0 | 0 |
master_info_repository | FILE | TABLE | FILE |
master_verify_checksum | OFF | OFF | OFF |
max_allowed_packet | 4194304 | 4194304 | 16777216 |
max_binlog_cache_size | 18446744073709547520 | 18446744073709547520 | 18446744073709547520 |
max_binlog_size | 1073741824 | 134217728 | 1073741824 |
max_binlog_stmt_cache_size | 18446744073709547520 | 18446744073709547520 | 18446744073709547520 |
max_connect_errors | 100 | 100 | 1000000 |
max_connections | 151 | 20463 | 20463 |
max_delayed_threads | 20 | 20 | 20 |
max_error_count | 64 | 64 | 64 |
max_heap_table_size | 16777216 | 16777216 | 67108864 |
max_insert_delayed_threads | 20 | 20 | 20 |
max_join_size | 18446744073709551615 | 18446744073709551615 | 18446744073709551615 |
max_length_for_sort_data | 1024 | 1024 | 1024 |
max_prepared_stmt_count | 16382 | 16382 | 16382 |
max_relay_log_size | 0 | 0 | 0 |
max_seeks_for_key | 18446744073709551615 | 18446744073709551615 | 18446744073709551615 |
max_sort_length | 1024 | 1024 | 1024 |
max_sp_recursion_depth | 0 | 0 | 0 |
max_tmp_tables | 32 | 32 | 32 |
max_user_connections | 0 | 0 | 0 |
max_write_lock_count | 18446744073709551615 | 18446744073709551615 | 18446744073709551615 |
metadata_locks_cache_size | 1024 | 1024 | 1024 |
metadata_locks_hash_instances | 8 | 8 | 8 |
min_examined_row_limit | 0 | 0 | 0 |
multi_range_count | 256 | 256 | 256 |
myisam_data_pointer_size | 6 | 6 | 6 |
myisam_max_sort_file_size | 9223372036853727232 | 9223372036853727232 | 9223372036853727232 |
myisam_mmap_size | 18446744073709551615 | 18446744073709551615 | 18446744073709551615 |
myisam_recover_options | OFF | OFF | “BACKUP,FORCE” |
myisam_repair_threads | 1 | 1 | 1 |
myisam_sort_buffer_size | 8388608 | 8388608 | 8388608 |
myisam_stats_method | nulls_unequal | nulls_unequal | nulls_unequal |
myisam_use_mmap | OFF | OFF | OFF |
net_buffer_length | 16384 | 16384 | 16384 |
net_read_timeout | 30 | 30 | 30 |
net_retry_count | 10 | 10 | 10 |
net_write_timeout | 60 | 60 | 60 |
new | OFF | OFF | OFF |
old | OFF | OFF | OFF |
old_alter_table | OFF | OFF | OFF |
old_passwords | 0 | 0 | 0 |
open_files_limit | 5000 | 65535 | 102315 |
optimizer_prune_level | 1 | 1 | 1 |
optimizer_search_depth | 62 | 62 | 62 |
optimizer_switch | “index_merge=on,index_merge_union=on…” | “index_merge=on,index_merge_union=on…” | “index_merge=on,index_merge_union=on…” |
optimizer_trace | “enabled=off,one_line=off” | “enabled=off,one_line=off” | “enabled=off,one_line=off” |
optimizer_trace_features | greedy_search=on… | greedy_search=on… | greedy_search=on… |
optimizer_trace_limit | 1 | 1 | 1 |
optimizer_trace_max_mem_size | 16384 | 16384 | 16384 |
optimizer_trace_offset | -1 | -1 | -1 |
performance_schema | ON | OFF | ON |
performance_schema_accounts_size | 100 | -1 | 100 |
performance_schema_digests_size | 10000 | -1 | 10000 |
performance_schema_events_stages_history_long_size | 10000 | -1 | 10000 |
performance_schema_events_stages_history_size | 10 | -1 | 10 |
performance_schema_events_statements_history_long_size | 10000 | -1 | 10000 |
performance_schema_events_statements_history_size | 10 | -1 | 10 |
performance_schema_events_waits_history_long_size | 10000 | -1 | 10000 |
performance_schema_events_waits_history_size | 10 | -1 | 10 |
performance_schema_hosts_size | 100 | -1 | 100 |
performance_schema_max_cond_classes | 80 | 80 | 80 |
performance_schema_max_cond_instances | 3504 | -1 | 90144 |
performance_schema_max_file_classes | 50 | 50 | 50 |
performance_schema_max_file_handles | 32768 | 32768 | 32768 |
performance_schema_max_file_instances | 7693 | -1 | 157408 |
performance_schema_max_mutex_classes | 200 | 200 | 200 |
performance_schema_max_mutex_instances | 15906 | -1 | 164738 |
performance_schema_max_rwlock_classes | 40 | 40 | 40 |
performance_schema_max_rwlock_instances | 9102 | -1 | 65902 |
performance_schema_max_socket_classes | 10 | 10 | 10 |
performance_schema_max_socket_instances | 322 | -1 | 40946 |
performance_schema_max_stage_classes | 150 | 150 | 150 |
performance_schema_max_statement_classes | 168 | 168 | 168 |
performance_schema_max_table_handles | 4000 | -1 | 8192 |
performance_schema_max_table_instances | 12500 | -1 | 12500 |
performance_schema_max_thread_classes | 50 | 50 | 50 |
performance_schema_max_thread_instances | 402 | -1 | 41026 |
performance_schema_session_connect_attrs_size | 512 | -1 | 512 |
performance_schema_setup_actors_size | 100 | 100 | 100 |
performance_schema_setup_objects_size | 100 | 100 | 100 |
performance_schema_users_size | 100 | -1 | 100 |
pid_file | /var/lib/mysql/localhost.localdomain.pid | /rdsdbdata/log/mysql-3306.pid | /var/lib/mysql/mysql.pid |
plugin_dir | /usr/lib64/mysql/plugin/ | /rdsdbbin/mysql-5.6.17.R1/lib/plugin/ | /usr/lib64/mysql/plugin/ |
port | 3306 | 3306 | 3306 |
preload_buffer_size | 32768 | 32768 | 32768 |
profiling | OFF | OFF | OFF |
profiling_history_size | 15 | 15 | 15 |
protocol_version | 10 | 10 | 10 |
proxy_user | |||
pseudo_slave_mode | OFF | OFF | OFF |
pseudo_thread_id | 10 | 1680 | 3193 |
query_alloc_block_size | 8192 | 8192 | 8192 |
query_cache_limit | 1048576 | 1048576 | 1048576 |
query_cache_min_res_unit | 4096 | 4096 | 4096 |
query_cache_size | 1048576 | 1048576 | 0 |
query_cache_type | OFF | OFF | OFF |
query_cache_wlock_invalidate | OFF | OFF | OFF |
query_prealloc_size | 8192 | 8192 | 8192 |
rand_seed1 | 0 | 0 | 0 |
rand_seed2 | 0 | 0 | 0 |
range_alloc_block_size | 4096 | 4096 | 4096 |
read_buffer_size | 131072 | 262144 | 131072 |
read_only | OFF | OFF | OFF |
read_rnd_buffer_size | 262144 | 524288 | 262144 |
relay_log | /rdsdbdata/log/relaylog/relaylog | ||
relay_log_basename | /rdsdbdata/log/relaylog/relaylog | ||
relay_log_index | /rdsdbdata/log/relaylog/relaylog.index | ||
relay_log_info_file | relay-log.info | relay-log.info | relay-log.info |
relay_log_info_repository | FILE | TABLE | FILE |
relay_log_purge | ON | ON | ON |
relay_log_recovery | OFF | ON | OFF |
relay_log_space_limit | 0 | 0 | 0 |
report_host | |||
report_password | |||
report_port | 3306 | 3306 | 3306 |
report_user | |||
rpl_stop_slave_timeout | 31536000 | 31536000 | 31536000 |
secure_auth | ON | ON | ON |
secure_file_priv | /tmp/ | ||
server_id | 0 | 1875561690 | 1 |
server_id_bits | 32 | 32 | 32 |
server_uuid | 88003e51-0699-11e4-b33a-a0d3c104d7d4 | 0ba6f778-0118-11e4-8f53-066a99301f11 | 3996a66b-06ae-11e4-b3c1-a0d3c104d7d4 |
skip_external_locking | ON | ON | ON |
skip_name_resolve | OFF | OFF | OFF |
skip_networking | OFF | OFF | OFF |
skip_show_database | OFF | OFF | OFF |
slave_allow_batching | OFF | OFF | OFF |
slave_checkpoint_group | 512 | 512 | 512 |
slave_checkpoint_period | 300 | 300 | 300 |
slave_compressed_protocol | OFF | OFF | OFF |
slave_exec_mode | STRICT | STRICT | STRICT |
slave_load_tmpdir | /tmp | /rdsdbdata/tmp | /tmp |
slave_max_allowed_packet | 1073741824 | 1073741824 | 1073741824 |
slave_net_timeout | 3600 | 3600 | 3600 |
slave_parallel_workers | 0 | 0 | 0 |
slave_pending_jobs_size_max | 16777216 | 16777216 | 16777216 |
slave_rows_search_algorithms | “TABLE_SCAN,INDEX_SCAN” | “TABLE_SCAN,INDEX_SCAN” | “TABLE_SCAN,INDEX_SCAN” |
slave_skip_errors | OFF | OFF | OFF |
slave_sql_verify_checksum | ON | ON | ON |
slave_transaction_retries | 10 | 10 | 10 |
slave_type_conversions | |||
slow_launch_time | 2 | 2 | 2 |
slow_query_log | OFF | OFF | ON |
slow_query_log_file | /var/lib/mysql/localhost-slow.log | /rdsdbdata/log/slowquery/mysql-slowquery.log | /var/lib/mysql/mysql-slow.log |
socket | /var/lib/mysql/mysql.sock | /tmp/mysql.sock | /var/lib/mysql/mysql.sock |
sort_buffer_size | 262144 | 262144 | 262144 |
sql_auto_is_null | OFF | OFF | OFF |
sql_big_selects | ON | ON | ON |
sql_buffer_result | OFF | OFF | OFF |
sql_log_bin | ON | ON | ON |
sql_log_off | OFF | OFF | OFF |
sql_mode | “STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION” | NO_ENGINE_SUBSTITUTION | NO_ENGINE_SUBSTITUTION |
sql_notes | ON | ON | ON |
sql_quote_show_create | ON | ON | ON |
sql_safe_updates | OFF | OFF | OFF |
sql_select_limit | 18446744073709551615 | 18446744073709551615 | 18446744073709551615 |
sql_slave_skip_counter | 0 | 0 | 0 |
sql_warnings | OFF | OFF | OFF |
ssl_ca | /rdsdbdata/rds-metadata/ca-cert.pem | ||
ssl_capath | |||
ssl_cert | /rdsdbdata/rds-metadata/server-cert.pem | ||
ssl_cipher | EXP1024-RC4-SHA… | ||
ssl_crl | |||
ssl_crlpath | |||
ssl_key | /rdsdbdata/rds-metadata/server-key.pem | ||
storage_engine | InnoDB | InnoDB | InnoDB |
stored_program_cache | 256 | 256 | 256 |
sync_binlog | 0 | 1 | 1 |
sync_frm | ON | ON | ON |
sync_master_info | 10000 | 10000 | 10000 |
sync_relay_log | 10000 | 10000 | 10000 |
sync_relay_log_info | 10000 | 10000 | 10000 |
system_time_zone | JST | UTC | JST |
table_definition_cache | 1400 | 1400 | 4096 |
table_open_cache | 2000 | 2000 | 4096 |
table_open_cache_instances | 1 | 16 | 1 |
thread_cache_size | 9 | 100 | 256 |
thread_concurrency | 10 | 10 | 10 |
thread_handling | one-thread-per-connection | one-thread-per-connection | one-thread-per-connection |
thread_stack | 262144 | 262144 | 262144 |
time_format | %H:%i:%s | %H:%i:%s | %H:%i:%s |
time_zone | SYSTEM | UTC | SYSTEM |
timed_mutexes | OFF | OFF | OFF |
timestamp | 1404826542.811469 | 1404719791.828739 | 1405077097.750732 |
tmp_table_size | 16777216 | 16777216 | 67108864 |
tmpdir | /tmp | /rdsdbdata/tmp | /tmp |
transaction_alloc_block_size | 8192 | 8192 | 8192 |
transaction_allow_batching | OFF | OFF | OFF |
transaction_prealloc_size | 4096 | 4096 | 4096 |
tx_isolation | REPEATABLE-READ | REPEATABLE-READ | REPEATABLE-READ |
tx_read_only | OFF | OFF | OFF |
unique_checks | ON | ON | ON |
updatable_views_with_limit | YES | YES | YES |
version | 5.6.17 | 5.6.17 | 5.6.17-log |
version_comment | MySQL Community Server (GPL) | MySQL Community Server (GPL) | MySQL Community Server (GPL) |
version_compile_machine | x86_64 | x86_64 | x86_64 |
version_compile_os | Linux | Linux | Linux |
wait_timeout | 28800 | 28800 | 28800 |
warning_count | 0 | 0 | 0 |
sysbench-lua 0.5について
sysbenchは、mysqlやmariadb/perconaなどでよく使われているDBベンチマークツールです。
本来はCPUやメモリの性能を測定する目的のものですが、機能拡張によりRDBMSのベンチマークも可能になっています。
今回は8個のテーブル、40000000行に対し、スレッド数を1 2 4 8 16 32 64 128 256と可変させながらioDrive2および、RDSのインスタンスに対しベンチマークを行いました。
なお、計測したクエリは以下の通りです。
oltp.lua
pathtest = string.match(test, “(.*/)”) or “” dofile(pathtest .. “common.lua”) function thread_init(thread_id) set_vars() if (db_driver == “mysql” and mysql_table_engine == “myisam”) then begin_query = “LOCK TABLES sbtest WRITE” commit_query = “UNLOCK TABLES” else begin_query = “BEGIN” commit_query = “COMMIT” end end function event(thread_id) local rs local i local table_name local range_start local c_val local pad_val local query table_name = “sbtest”.. sb_rand_uniform(1, oltp_tables_count) db_query(begin_query) for i=1, oltp_point_selects do rs = db_query(“SELECT c FROM “.. table_name ..” WHERE id=” .. sb_rand(1, oltp_table_size)) end for i=1, oltp_simple_ranges do range_start = sb_rand(1, oltp_table_size) rs = db_query(“SELECT c FROM “.. table_name ..” WHERE id BETWEEN ” .. range_start .. ” AND ” .. range_start .. “+” .. oltp_range_size – 1) end for i=1, oltp_sum_ranges do range_start = sb_rand(1, oltp_table_size) rs = db_query(“SELECT SUM(K) FROM “.. table_name ..” WHERE id BETWEEN ” .. range_start .. ” AND ” .. range_start .. “+” .. oltp_range_size – 1) end for i=1, oltp_order_ranges do range_start = sb_rand(1, oltp_table_size) rs = db_query(“SELECT c FROM “.. table_name ..” WHERE id BETWEEN ” .. range_start .. ” AND ” .. range_start .. “+” .. oltp_range_size – 1 .. ” ORDER BY c”) end for i=1, oltp_distinct_ranges do range_start = sb_rand(1, oltp_table_size) rs = db_query(“SELECT DISTINCT c FROM “.. table_name ..” WHERE id BETWEEN ” .. range_start .. ” AND ” .. range_start .. “+” .. oltp_range_size – 1 .. ” ORDER BY c”) end if not oltp_read_only then for i=1, oltp_index_updates do rs = db_query(“UPDATE ” .. table_name .. ” SET k=k+1 WHERE id=” .. sb_rand(1, oltp_table_size)) end for i=1, oltp_non_index_updates do c_val = sb_rand_str(“###########-###########-###########-###########-###########-###########-###########-###########-###########-###########”) query = “UPDATE ” .. table_name .. ” SET c='” .. c_val .. “‘ WHERE id=” .. sb_rand(1, oltp_table_size) rs = db_query(query) if rs then print(query) end end i = sb_rand(1, oltp_table_size) rs = db_query(“DELETE FROM ” .. table_name .. ” WHERE id=” .. i) c_val = sb_rand_str([[ ###########-###########-###########-###########-###########-###########-###########-###########-###########-###########]]) pad_val = sb_rand_str([[ ###########-###########-###########-###########-###########]]) rs = db_query(“INSERT INTO ” .. table_name .. ” (id, k, c, pad) VALUES ” .. string.format(“(%d, %d, ‘%s’, ‘%s’)”,i, sb_rand(1, oltp_table_size) , c_val, pad_val)) end — oltp_read_only db_query(commit_query) end
ベンチマーク結果
かなり傾向の違うグラフになっていますが、並列度が増大した際には比較的優位な結果が出ています。
TPS # read only
Thread | FusionIO-MySQL-5.6.17 | Amazon RDS-MySQL-5.6.17 |
---|---|---|
1 | 226.95 | 23.59 |
2 | 432.07 | 42.68 |
4 | 843.74 | 71.26 |
8 | 1639.6 | 162.16 |
16 | 2803.5 | 312.07 |
32 | 4009.1 | 566.66 |
64 | 3497.2 | 641.28 |
128 | 3545.2 | 607.47 |
256 | 3309.8 | 482.38 |
TPS # read/write
Thread | FusionIO-MySQL-5.6.17 | Amazon RDS-MySQL-5.6.17 |
---|---|---|
1 | 127.85 | 15.52 |
2 | 247.43 | 38.82 |
4 | 475.39 | 66.02 |
8 | 727.45 | 116.92 |
16 | 793.82 | 272.29 |
32 | 734.82 | 478.45 |
64 | 685.91 | 622.67 |
128 | 671.45 | 615.35 |
256 | 636.12 | 609.32 |
avg read only
Thread | FusionIO-MySQL-5.6.17 | Amazon RDS-MySQL-5.6.17 |
---|---|---|
1 | 42.39 | 4.4 |
2 | 46.86 | 4.63 |
4 | 56.13 | 4.74 |
8 | 49.33 | 4.88 |
16 | 51.26 | 5.7 |
32 | 56.46 | 7.98 |
64 | 99.78 | 18.3 |
128 | 210.63 | 36.1 |
256 | 530.32 | 77.33 |
avg read/write
Thread | FusionIO-MySQL-5.6.17 | Amazon RDS-MySQL-5.6.17 |
---|---|---|
1 | 64.42 | 7.82 |
2 | 51.51 | 8.08 |
4 | 60.58 | 8.41 |
8 | 68.42 | 10.99 |
16 | 58.75 | 20.15 |
32 | 66.87 | 43.54 |
64 | 102.77 | 93.3 |
128 | 207.97 | 190.62 |
256 | 420 | 401.67 |
99 read only
Thread | FusionIO-MySQL-5.6.17 | Amazon RDS-MySQL-5.6.17 |
---|---|---|
1 | 44.51 | 4.64 |
2 | 53.26 | 4.9 |
4 | 72.1 | 5.07 |
8 | 71.37 | 5.33 |
16 | 73.6 | 7.13 |
32 | 79.58 | 12.15 |
64 | 129.79 | 30.56 |
128 | 276.54 | 60.1 |
256 | 777.19 | 144.17 |
99 read/write
Thread | FusionIO-MySQL-5.6.17 | Amazon RDS-MySQL-5.6.17 |
---|---|---|
1 | 9.35 | 67.38 |
2 | 10.94 | 55.04 |
4 | 12.46 | 88.03 |
8 | 26.02 | 89.09 |
16 | 420.75 | 88.22 |
32 | 684.96 | 93.35 |
64 | 1069.3 | 131.04 |
128 | 1672.9 | 237.82 |
256 | 3091 | 461.53 |
元記事はこちらです。
「Direct connect経由なFusion-IOとRDSはどっちが速いのかを繋いで、ベンチマークしてみた。」