ActiveRecord :: StatementInvalid: Mysql2 :: Error :: TimeoutError - PullRequest
0 голосов
/ 01 апреля 2020

периодически, когда много людей (~ 60) на сайте, я получаю такие ошибки:

ActiveRecord::ConnectionTimeoutError: could not obtain a connection from the pool within 5.000 seconds (waited 5.000 seconds); all pooled connections were in use
ActiveRecord::StatementInvalid: Mysql2::Error::TimeoutError: Lock wait timeout exceeded; try restarting transaction: UPDATE rooms SET room_profiles_count = COALESCE(`room_profiles_count`, 0) + 1 WHERE rooms.id = 1363
ActiveRecord::StatementInvalid: Mysql2::Error::TimeoutError: Lock wait timeout exceeded; try restarting transaction: DELETE FROM room_profiles WHERE room_profiles.id = 3942

Я пытался увеличить пул до 100, но все равно получаю ошибку Мой стек: rails 5, puma, mysql

здесь my configure puma & database.yml

Подскажите, пожалуйста, как мне решить эту проблему?

...