我使用Mysql 5.2插入大量记录(近十亿条记录)
我正在使用以下设置。
我可以更改哪些参数以获得最佳插入和查询速度?
我只创建5个表,我的查询被限制为10个包含多个连接。
以下是我正在使用的设置:
back_log = 50
max_connections = 1024
max_connect_errors = 10
table_open_cache = 2048
max_allowed_packet = 16M
binlog_cache_size = 1M
max_heap_table_size = 64M
read_buffer_size = 2M
read_rnd_buffer_size = 16M
sort_buffer_size = 8M
join_buffer_size = 8M
thread_cache_size = 64
thread_concurrency = 24
query_cache_size = 0
query_cache_limit = 0
ft_min_word_len = 4
default_storage_engine = MYISAM
thread_stack = 192K
transaction_isolation = READ-COMMITTED
tmp_table_size = 64M
log_bin = mysql-bin
expire_logs_days = 7
max_binlog_size = 100M
binlog_format = mixed
slow_query_log
long_query_time = 2
server_id = 11
skip_external_locking
key_buffer_size = 32M
delay_key_write = all
bulk_insert_buffer_size = 64M
myisam_sort_buffer_size = 128M
**myisam_max_sort_file_size = 10G**
myisam_repair_threads = 2
myisam_recover
innodb_additional_mem_pool_size = 16M
**innodb_buffer_pool_size = 16G**
innodb_data_file_path = ibdata1:32M;ibdata2:32M;ibdata3:32M;ibdata4:32M:autoextend
innodb_file_io_threads = 4
innodb_thread_concurrency = 24
innodb_flush_log_at_trx_commit = 0
innodb_log_buffer_size = 8M
innodb_log_file_size = 256M
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
innodb_doublewrite = 0
skip-innodb_doublewrite
innodb_lock_wait_timeout = 120
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 512M
sort_buffer_size = 512M
read_buffer = 8M
write_buffer = 8M
[mysqlhotcopy]
interactive-timeout