performance - Speed up InnoDB mysql database import -
i got new mysql machine (16gb ram, 4x sas 15k rpm 300gb drives in raid10), quite fast machine.
i have been importing few databases couple million items each, takes quite long time, longer should think. i'm seeing 1000 inserts per second, , believe should able more. longer process runs, slower gets.
this config, tips speed things up, doesn't hurt reliability of data.
[mysqld] skip-name-resolve datadir=/var/lib/mysql #socket=/tmp/mysql.sock log-error=/var/log/mysqld.log port=48221 user=mysql old_passwords=0 max_connections = 1500 table_cache = 1024 max_allowed_packet = 16m sort_buffer_size = 2m thread_cache = 8 thread_concurrency = 32 query_cache_size = 0m query_cache_type = 0 default-storage-engine = innodb transaction_isolation = repeatable-read tmp_table_size = 256m long_query_time = 3 log_slow_queries = 1 innodb_additional_mem_pool_size=48m innodb_flush_log_at_trx_commit=2 innodb_log_buffer_size=32m innodb_buffer_pool_size=2g innodb_autoinc_lock_mode=2 innodb_io_capacity=500 innodb_read_io_threads=16 innodb_write_io_threads=8 innodb_buffer_pool_size = 5000m innodb_lock_wait_timeout = 300 innodb_max_dirty_pages_pct = 90 innodb_thread_concurrency =32 [mysqldump] quick single-transaction [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid
you drop indexes duration of import, , rebuild them when it's done. should try chunking inserts, searching sweet spot between autocommit , inserts in single transaction.
Comments
Post a Comment