2011-02-21 72 views
1

私たちは、同じ別のサーバで数dbsに達するサービスを持っています。サービスは停止しましたが、mysqlはすべての接続を中断せず、非常に長い時間オープンしていました。以下はmysqlログです。接続IDに基づいて、最後の行で報告された接続が00:01に残りのものと打ち切られているはずですが、2時間以上掛かっていることがわかります。MySQLは接続の切断を判断するのに時間がかかります

110216 0:00:01 [Warning] Aborted connection 11864307 to db: 'foodb' user: 'db_user' host: '10.234.1.15' (Got an error reading communication packets) 
110216 0:00:01 [Warning] Aborted connection 11865442 to db: 'bardb' user: 'db_user' host: '10.234.1.15' (Got an error reading communication packets) 
110216 0:00:01 [Warning] Aborted connection 11864559 to db: 'bardb' user: 'db_user' host: '10.234.1.15' (Got an error reading communication packets) 
110216 0:00:01 [Warning] Aborted connection 11863856 to db: 'bardb' user: 'db_user' host: '10.234.1.15' (Got an error reading communication packets) 
110216 0:00:01 [Warning] Aborted connection 11865445 to db: 'bardb' user: 'db_user' host: '10.234.1.15' (Got an error reading communication packets) 
110216 0:00:01 [Warning] Aborted connection 11864581 to db: 'bardb' user: 'db_user' host: '10.234.1.15' (Got an error reading communication packets) 
110216 0:00:01 [Warning] Aborted connection 11865447 to db: 'bardb' user: 'db_user' host: '10.234.1.15' (Got an error reading communication packets) 
110216 0:00:01 [Warning] Aborted connection 11864566 to db: 'bardb' user: 'db_user' host: '10.234.1.15' (Got an error reading communication packets) 
110216 0:00:01 [Warning] Aborted connection 11865451 to db: 'bardb' user: 'db_user' host: '10.234.1.15' (Got an error reading communication packets) 
110216 0:00:01 [Warning] Aborted connection 11865446 to db: 'bardb' user: 'db_user' host: '10.234.1.15' (Got an error reading communication packets) 
110216 0:00:01 [Warning] Aborted connection 11865444 to db: 'bardb' user: 'db_user' host: '10.234.1.15' (Got an error reading communication packets) 
110216 0:00:01 [Warning] Aborted connection 11864565 to db: 'bardb' user: 'db_user' host: '10.234.1.15' (Got an error reading communication packets) 
110216 0:00:01 [Warning] Aborted connection 11865490 to db: 'foodb' user: 'db_user' host: '10.234.1.15' (Got an error reading communication packets) 
110216 0:00:01 [Warning] Aborted connection 11864251 to db: 'bardb' user: 'db_user' host: '10.234.1.15' (Got an error reading communication packets) 
110216 0:00:01 [Warning] Aborted connection 11864299 to db: 'bardb' user: 'db_user' host: '10.234.1.15' (Got an error reading communication packets) 
110216 0:00:01 [Warning] Aborted connection 11864303 to db: 'bardb' user: 'db_user' host: '10.234.1.15' (Got an error reading communication packets) 
110216 0:00:01 [Warning] Aborted connection 11865486 to db: 'foodb' user: 'db_user' host: '10.234.1.15' (Got an error reading communication packets) 
110216 0:00:01 [Warning] Aborted connection 11864304 to db: 'foodb' user: 'db_user' host: '10.234.1.15' (Got an error reading communication packets) 
110216 0:00:01 [Warning] Aborted connection 11864560 to db: 'bardb' user: 'db_user' host: '10.234.1.15' (Got an error reading communication packets) 
110216 0:00:01 [Warning] Aborted connection 11864268 to db: 'foodb' user: 'db_user' host: '10.234.1.15' (Got an error reading communication packets) 
110216 0:00:01 [Warning] Aborted connection 11865055 to db: 'bardb' user: 'db_user' host: '10.234.1.15' (Got an error reading communication packets) 
110216 0:00:01 [Warning] Aborted connection 11865443 to db: 'bardb' user: 'db_user' host: '10.234.1.15' (Got an error reading communication packets) 
110216 0:00:01 [Warning] Aborted connection 11865450 to db: 'bardb' user: 'db_user' host: '10.234.1.15' (Got an error reading communication packets) 
110216 0:00:02 [Warning] Aborted connection 11865448 to db: 'bardb' user: 'db_user' host: '10.234.1.15' (Got an error reading communication packets) 
110216 0:00:02 [Warning] Aborted connection 11865485 to db: 'foodb' user: 'db_user' host: '10.234.1.15' (Got an error reading communication packets) 
110216 2:11:17 [Warning] Aborted connection 11865449 to db: 'bardb' user: 'db_user' host: '10.234.1.15' (Got an error reading communication packets) 

さて、これは、MySQLの問題ですと仮定すると、以下のタイムアウト設定を考えると、おそらくこれを引き起こしている可能性はありますか?

mysql> show variables like '%time%'; 
+----------------------------+-------------------+ 
| Variable_name    | Value    | 
+----------------------------+-------------------+ 
| connect_timeout   | 10    | 
| datetime_format   | %Y-%m-%d %H:%i:%s | 
| delayed_insert_timeout  | 300    | 
| flush_time     | 0     | 
| innodb_lock_wait_timeout | 600    | 
| innodb_rollback_on_timeout | OFF    | 
| interactive_timeout  | 28800    | 
| lc_time_names    | en_US    | 
| long_query_time   | 5     | 
| net_read_timeout   | 30    | 
| net_write_timeout   | 60    | 
| slave_net_timeout   | 3600    | 
| slow_launch_time   | 2     | 
| system_time_zone   | GMT    | 
| table_lock_wait_timeout | 50    | 
| time_format    | %H:%i:%s   | 
| time_zone     | SYSTEM   | 
| timed_mutexes    | OFF    | 
| wait_timeout    | 28800    | 
+----------------------------+-------------------+ 

mysql> show variables like '%packet%'; 
+--------------------+----------+ 
| Variable_name  | Value | 
+--------------------+----------+ 
| max_allowed_packet | 16777216 | 
+--------------------+----------+ 
+0

max_packet_sizeとは何ですか? – Zimbabao

+0

編集を参照してください。私はmax_packet_size変数を持っていません。 – DanInDC

+0

それは私が何を意味しました。あなたは16MBのサイズのクエリを持っていますか?そうではないようですが、 – Zimbabao

答えて

1

max_allowed_sizeはデフォルトで1Mでなければならず、巨大なデータ、BLOBなどでクエリを作成しましたか?その値を8Mに増やしてください(1GBは最大限です)。

wait_timeoutを50分の1に減らします。

wait_timeoutは"サーバーが非対話型接続で閉じるまでに待機する秒数。このタイムアウトはTCP/IPおよびUNIXソケットファイル接続にのみ適用され、名前付きパイプまたは共有メモリ" Details

+0

私はあなたに同意します。 wait_timeoutはそれを説明しません。 – DanInDC

+0

あなたのmax_allowed_sizeは依然としてデフォルトで1Mでなければならず、いくつかのクエリはその制限を超えています。 – Zimbabao

関連する問題