API query to Red Hat Satellite 6 getting timed out.

Solution Verified - Updated

Environment

  • Red Hat Satellite 6

Issue

  • API query to Red Hat Satellite 6 getting timed out :

Content from satellite.example.com is not included.https://satellite.example.com/api/hosts?thin=true&per_page=1000

Resolution

  • Need to run openscp arf report task cleanup, to cleanup the old files :

      /usr/sbin/foreman-rake reports:expire report_type=ForemanOpenscap::ArfReport days=30
    
      # foreman-maintain service stop
      # systemctl start postgresql
      # echo "vacuum full analyze" | su - postgres -c "psql foreman"
      # echo "vacuum full analyze" | su - postgres -c "psql candlepin"
     # echo "reindex database foreman" | su - postgres -c "psql foreman"
     # echo "reindex database candlepin" | su - postgres -c "psql candlepin"
     # systemctl stop postgresql
     # foreman-maintain service start
    

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

Root Cause

  • The logs table seems pretty big with almost 10 million registries. One Arf report can be responsible for hundreds of lines there, so expiring some old reports will offer a good relief that should impact in the performance of the API request.

Diagnostic Steps

# echo "select count(*) from logs"|su - postgres -c "psql foreman"
count
---------
9947675
  (1 row)
  # echo "select count(*) from reports"|su - postgres -c "psql foreman"
 count
  --------
   342661
  (1 row)
  # cat /var/log/foreman/production.log shows failure logs :

  15/11 - x.x.x.x - x.x.x.x (IP) - succeeded
  16/11 - x.x.x.x - x.x.x.x (IP) - failed
  17/11 - x.x.x.x - x.x.x.x (IP) - failed
  18/11 - x.x.x.x - x.x.x.x (IP) - succeeded
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.