我使用多個jdbc來執行數據遷移的全表查詢。當我使用並行75 jdbc查詢每個表有近3000000行的差異表時,我發現MySQL在所有數據返回給jdbc之前中止一個連接。MySQL中止連接未知錯誤
慢日誌:
Time: 160919 9:09:38
[email protected]: test[test] @ [10.142.90.20]
Thread_id: 349 Schema: mmig_1005 QC_hit: No
Query_time: 161.997180 Lock_time: 0.000560 Rows_sent: 619246 Rows_examined: 619246
Full_scan: Yes Full_join: No Tmp_table: No Tmp_table_on_disk: No
Filesort: No Filesort_on_disk: No Merge_passes: 0
explain: id select_type table type possible_keys key key_len ref rows Extra
explain: 1 SIMPLE CAR_NEW_6 ALL NULL NULL NULL NULL 2923495
use mmig_1005;
SET timestamp=1474247378;
SELECT @@version, name, id, sharding_id, model
FROM CAR_NEW_6;
有表mmig_1005.car_new_6近300行,但MySQL的只是發送619246行和終止此連接。線程ID是349,然後我在mysql-err日誌中發現了這個被中止的連接349。
160919 9:09:38 [Warning] Aborted connection 349 to db: 'mmig_1005' user: 'test' host: '10.142.90.20' (Unknown error)
160919 9:09:38 [Warning] Aborted connection 305 to db: 'mmig_1001' user: 'test' host: '10.142.90.20' (Unknown error)
MySQL的參數:
connect_timeout 10
deadlock_timeout_long 50000000
deadlock_timeout_short 10000
delayed_insert_timeout 300
innodb_flush_log_at_timeout 1
innodb_lock_wait_timeout 45
innodb_rollback_on_timeout OFF
interactive_timeout 1800
lock_wait_timeout 600
net_read_timeout 7200
net_write_timeout 7200
rpl_semi_sync_master_timeout 10000
slave_net_timeout 30
sqlasyntimeout 10
sqlasynwarntimeout 3
thread_pool_idle_timeout 60
wait_timeout 1800
innodb_log_buffer_size 134217728
max_allowed_packet 1073741824
爲什麼MySQL的中止這方面都發送其數據之前?
一個查詢持續時間超過30分鐘? – Drew
@德魯,只有僕人迷你。 – Zeyu