很奇怪,线上 ngx_lua 通过 drizzle连接mysql
upstream 配置如下:
upstream testmysqlbackend {
drizzle_server 10.0.0.17:3306 dbname=db_test
password=test user=test protocol=mysql;
drizzle_keepalive max=100 mode=single overflow=reject;
}
偶尔会看到ngx 错误日志里面 connect() failed (104: Connection reset by peer) while connecting to upstream
通过tcp抓包,如下, 很奇怪,mysql会直接关闭连接,而且该请求重复去请求一次,是ok的。
10:27:47.974021 IP 10.0.0.166.38716 > 10.0.0.135.3306: Flags [P.], seq 3690263620:3690263723, ack 3104584192, win 208, options [nop,nop,TS val 3609071337 ecr 3024132972], length 103
10:27:47.974246 IP 10.0.0.135.3306 > 10.0.0.166.38716: Flags [R], seq 3104584192, win 0, length 0