Content View publish failed with error "could not obtain a connection from the pool within 5.000 seconds (waited 5.001 seconds)" in Red Hat Satellite Server

Solution Verified - Updated

Environment

  • Red Hat Satellite 6.9 and above

Issue

  • Content view publishing task in the Satellite server fails with the following error :
could not obtain a connection from the pool within 5.000 seconds (waited 5.001 seconds); all pooled connections were in use

Resolution

  • Meanwhile to improve the behavior and resolve the issue, refer to the following steps:
  • Ensure to apply suitable tuning to improve the performance and response time of the Satellite Server.

  • If the tuning was ineffective, then run the following command in the Red Hat Satellite server to increase the PostgreSQL database pool size followed by a restart of satellite services:

     ```
     # satellite-installer --foreman-db-pool=10
     # satellite-maintain service restart
     ```
    
  • Verify the new DB Pool Size value from the /etc/foreman/database.yml file.

     ```
     # cat  /etc/foreman/database.yml | grep -i pool
     pool: 10                                                                       ## current pool value 
     ```
    
  • Determining the approximate possible values for the database pool size based on system resources:

      |CPU|RAM (GB)|Pool Size|
    

-|-|-
| 4 |20|15|
|4 - 8|32|20 - 30|
|8+|40+|>=32 - <=64|

 

For more KB articles/solutions related to Red Hat Satellite 6.x Content View Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Content View Issues

Root Cause

  • By default, the size of the connection pool is 5 for PostgreSQL database. But under heavy load, using the PostgreSQL adapter, the default pool size may not be good enough to process all the requests leading to the errors as described in the Issue section of this article.

Diagnostic Steps

  • Following errors have been observed in /var/log/foreman/production.log file in the Satellite server.
2022-09-10T10:36:02 [I|bac] Backtrace for 'Action failed' error (ActiveRecord::ConnectionTimeoutError): could not obtain a connection from the pool within 5.000 seconds (waited 5.001 seconds); all pooled connections were in use
SBR
Product(s)
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.