2013-12-11 28 views
0

您好,我的服務器有24核心和32GB的內存。 我一次做多個「插入選擇」5千萬行。 這需要大約15小時的查詢,但它只有100%的CPU只有一個CPU,我試圖讓MySQL(5.5)(InnoDB)使用更多的資源。24核心和MYSQL使用1上INSERT

我已經閱讀了關於它的多個線程,但我沒有得到它的工作。

大多數信息都是關於加入innodb_thread_concurrency = 0 但我仍然沒有結果。

port  = 3306 
socket  = /var/run/mysqld/mysqld.sock 

[mysqld_safe] 
socket  = /var/run/mysqld/mysqld.sock 
nice  = 0 

[mysqld] 
user  = mysql 
pid-file = /var/run/mysqld/mysqld.pid 
socket  = /var/run/mysqld/mysqld.sock 
port  = 3306 
basedir  = /usr 
datadir  = /media/ssd/db 
tmpdir  = /tmp 
lc-messages-dir = /usr/share/mysql 
skip-external-locking 
innodb_buffer_pool_size=26G 
innodb_thread_concurrency = 0 

bind-address = 127.0.0.1 
# 
# * Fine Tuning 
# 
key_buffer  = 1000M 
max_allowed_packet = 160M 
thread_stack  = 192K 
thread_cache_size  = 8 
# This replaces the startup script and checks MyISAM tables if needed 
# the first time they are touched 
myisam-recover   = BACKUP 
table_cache   = 800 

query_cache_limit = 5000M 
query_cache_size = 1600M 
join_buffer_size = 1000M 


log_error = /var/log/mysql/error.log 
# Here you can see queries with especially long duration 
log_slow_queries = /var/log/mysql/mysql-slow.log 
long_query_time = 2 
+0

您可能對[dba.stackexchange.com]更多的運氣(http://dba.stackexchange.com) –

+0

看起來更好地滿足在[數據庫管理] (http://dba.stackexchange.com/)類別。 –

回答

0

試試這個參數:

innodb_io_capacity=5000 (or even 20000 depending on your IO subsystem) 
innodb_buffer_pool_size=4G (for example) 
innodb_log_file_size=1G 
innodb_write_io_threads = 64 
innodb_read_io_threads = 64 
innodb_thread_concurrency = 0