mysql2 icon indicating copy to clipboard operation
mysql2 copied to clipboard

Problem with Aborted_clients

Open teacplusplus opened this issue 8 years ago • 5 comments

I have a problem with mysql2 gem 0.3.21 with ever-increasing Aborted_clients values. My rails version is 3.2.22. sudo mysql -e "SHOW GLOBAL STATUS LIKE 'aborted_clients'"; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | Aborted_clients | 260 | +-----------------+-------+

>> Mysql2::Client.new(host: "localhost", username: "root").close
>> Mysql2::Client.new(host: "localhost", username: "root").close
>> Mysql2::Client.new(host: "localhost", username: "root").close

sudo mysql -e "SHOW GLOBAL STATUS LIKE 'aborted_clients'"; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | Aborted_clients | 263 | +-----------------+-------+ It brings a lot of problems such as big log file and sadness my boss. Our project has a lot of db requests. I can not use a different version of rails, since it is associated with long-term project migration.

teacplusplus avatar Oct 17 '16 03:10 teacplusplus

This is fixed in #606. I don't think it was backported to 0.3.x though.

justincase avatar Oct 17 '16 12:10 justincase

That would be great. There are many projects that run on older versions of ror. And I know it was broken in the 0.3.15 version.

teacplusplus avatar Oct 17 '16 18:10 teacplusplus

2 years later, and I'm still getting this (with version 0.5.2) :(

Amnesthesia avatar Nov 01 '18 08:11 Amnesthesia

Me too with version 0.5.3 on rails 5.2. This is not really a problem in itself as the log verbosity can be adjusted, but I noticed that consequently, the mysql connection does not get closed either when a unicorn process is killed due to a timeout, which under heavy load means that the maximum number of connections is not bounded and ends up reaching any given limit very quickly.

danielristic avatar Aug 09 '20 07:08 danielristic

@danielristic Did you found any solution for it? I'm using same versions - 0.5.3 on rails 5.2 - and still getting this error

ketandoshi avatar Jun 05 '23 12:06 ketandoshi