当应用连接proxy,在执行查询时偶尔会报"lost connection to MYSQL server during query",但proxy与DB的连接(在proxy实现了一个连接池)没有异常,这是什么原因?

解决方案 »

  1.   

    是不是 %timeout 之类的参数的原因?mysql> show variables like '%timeout%';
    +----------------------------+-------+
    | Variable_name              | Value |
    +----------------------------+-------+
    | connect_timeout            | 10    |
    | delayed_insert_timeout     | 300   |
    | innodb_lock_wait_timeout   | 50    |
    | innodb_rollback_on_timeout | OFF   |
    | interactive_timeout        | 28800 |
    | net_read_timeout           | 30    |
    | net_write_timeout          | 60    |
    | slave_net_timeout          | 3600  |
    | table_lock_wait_timeout    | 50    |
    | wait_timeout               | 28800 |
    +----------------------------+-------+
    10 rows in set (0.00 sec)mysql>
      

  2.   

    我使用mysql是4.4.18 proxy是0.6.1mysql> show variables like '%timeout';
    +--------------------------+-------+
    | Variable_name            | Value |
    +--------------------------+-------+
    | connect_timeout          | 5     |
    | delayed_insert_timeout   | 300   |
    | innodb_lock_wait_timeout | 8     |
    | interactive_timeout      | 28800 |
    | net_read_timeout         | 30    |
    | net_write_timeout        | 60    |
    | slave_net_timeout        | 3600  |
    | sync_replication_timeout | 0     |
    | wait_timeout             | 28800 |
    +--------------------------+-------+
    9 rows in set (0.00 sec)在proxy端监控到慢查询在1~2秒间,但也不至于报LOST connect...