lua-resty-mysql icon indicating copy to clipboard operation
lua-resty-mysql copied to clipboard

MySQL showing aborted mysql connection

Open pfremm opened this issue 9 years ago • 4 comments

Is anyone else seeing aborted mysql connections when using this? We are using percona mysql, and I am calling the db:close() as shown below. local ok, err = db:close() if not ok then ngx.log(ngx.DEBUG, 'failed to close: ', err) end

pfremm avatar Dec 14 '15 16:12 pfremm

@pfremm The aborted connection metric shown on the mysqld side is usually a false alarm since lua-resty-mysql avoids sending a mysql close packet on connection close (for performance reasons).

agentzh avatar Dec 14 '15 19:12 agentzh

Are you aware of creative ways to not have the aborted connection appear in the mysql log?

pfremm avatar Jan 04 '16 22:01 pfremm

@pfremm Enabling the MySQL connection pool via the set_keepalive method of the resty.mysql object can reduce connection closes a lot.

agentzh avatar Jan 05 '16 02:01 agentzh

@pfremm And it will also improve performance a lot if you are not already using it.

agentzh avatar Jan 05 '16 02:01 agentzh