Bug #24220

In development: ActiveRecord::ConnectionTimeoutError in the logs..Recovers after a few attempts..

Added by Samir Jha 7 days ago. Updated 5 days ago.

Status:Closed
Priority:Normal
Assignee:Ivan Necas
Category:-
Target version:1.19.0
Difficulty: Team Backlog:
Triaged:No Fixed in Releases:1.19.0
Bugzilla link: Found in Releases:
Pull request:https://github.com/theforeman/foreman/pull/5822, https://github.com/theforeman/puppet-katello_devel/pull/165, https://github.com/theforeman/foreman/pull/5827

Description

Get this error in the logs and the server takes some time to load since all connections are busy at the moment. ActiveRecord::ConnectionTimeoutError (could not obtain a connection from the pool within 5.000 seconds (waited 5.000 seconds); all pooled connections were in use)

Associated revisions

Revision d1778057
Added by Ivan Necas 5 days ago

Refs #24220 - increase recommended pool size for the db (#165)

Since Rails 5, it seems the webrick is not limited on single request at
a time, which leads to 500s when loading the dasboards, especially with
plugins.

Suggesting to increse the default pool size in the database.yml
to avoid users running into this.

Revision 8c7be857
Added by Ivan Necas 5 days ago

Fixes #24220 - increase recommended pool size for the db

Since Rails 5, it seems the webrick is not limited on single request at
a time, which leads to 500s when loading the dasboards, especially with
plugins.

Suggesting to increse the default pool size in the database.yml
to avoid users running into this.

History

#1 Updated by Justin Sherrill 6 days ago

  • Category deleted (Database)
  • Subject changed from ActiveRecord::ConnectionTimeoutError in the logs..Recovers after a few attempts.. to In development: ActiveRecord::ConnectionTimeoutError in the logs..Recovers after a few attempts..
  • Project changed from Katello to foreman-tasks

We've seen this a lot in katello, but it seems to only occur when the dynflow world gets initialized.

#2 Updated by Ivan Necas 5 days ago

  • Project changed from foreman-tasks to Foreman

I don't think it has anything to do with Foreman-Tasks, it seems that in rails 5, the lock on 1-request at a time was removed, which leads to the dashboard spinning up more concurrent requests that the db pool is ready for. The proper fix should be to increase the db pool in `config/database.yml`.

#3 Updated by The Foreman Bot 5 days ago

  • Assignee set to Ivan Necas
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/5827 added

#4 Updated by Ivan Necas 5 days ago

  • Pull request https://github.com/theforeman/puppet-katello_devel/pull/165 added

I've sent patches to foreman and katello_devel to increase the pool size with numbers I've stopped getting the issues like this.

#5 Updated by Tomer Brisker 5 days ago

  • Target version set to 1.19.0
  • Fixed in Releases 1.19.0 added

#6 Updated by Ivan Necas 5 days ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

#7 Updated by The Foreman Bot 5 days ago

  • Pull request https://github.com/theforeman/foreman/pull/5822 added

Also available in: Atom PDF