2011-02-21 5 views
1

동일한 서버에서 몇 db의 서비스를 제공합니다. 서비스는 중단되었지만 mysql은 모든 연결을 중단하지 않았으며 매우 긴 시간 동안 열린 상태로 유지했습니다. 아래는 mysql 로그입니다. 마지막 줄에서보고 된 연결이 00:01에 나머지 연결과 중단되어야하는 연결 ID를 기반으로 볼 수 있지만 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

그게 무슨 뜻인지. 너는 16 메가 바이트 크기의 질문이 있으신가요? – Zimbabao

답변

1

max_allowed_size는 기본적으로 1M이어야하며 거대한 데이터, blob 또는 기타와 함께 일부 쿼리를 작성 했습니까? 해당 값을 8M로 증가 시키십시오 (1GB는 최대 한계 임).

wait_timeout을 50 단계로 줄입니다.

wait_timeout이 "서버가 닫히기 전에 비 대화식 연결에서 작업을 대기하는 시간 (초)이 시간 초과는 TCP/IP 및 UNIX 소켓 파일 연결에만 적용되며 명명 된 파이프 또는 공유 메모리를 사용하여 만들어진 연결에는 적용되지 않습니다 . " Details

+0

그 외에 다른 연결이 중단되도록 트리거 된 것 외에는 제가 동의 할 겁니다. wait_timeout은 그것을 설명하지 않습니다. – DanInDC

+0

max_allowed_size는 여전히 1M 이상이어야하며 일부 쿼리는 해당 제한을 초과합니다. – Zimbabao

관련 문제