Removing orphaned content

If you synchronize content to orcharhino Server or orcharhino Proxy Servers and no longer wish to distribute it to hosts, you can get rid of content on orcharhino to free up disk space.

Orphaned content

Orphaned content is content that is not referenced in any published content view version and older in minutes than the Orphaned Content Protection Time setting. By default, orcharhino removes orphaned content once a week as defined in /etc/cron.d/katello.

Configuring custom cron jobs on orcharhino

You can set up a cron job on your orcharhino Server to remove orphaned content regularly.

Procedure
  1. On your orcharhino Server, duplicate the existing cron job:

    $ cat /etc/cron.d/katello | sed "/alternate.content/d" > /etc/cron.d/custom-orphan-cleanup
  2. Adjust the interval:

    $ vim /etc/cron.d/custom-orphan-cleanup

    For more information, see crontab.guru or man cron.

Recovering from a full disk

The following procedure describes how to resolve the situation when a logical volume (LV) with the Pulp database on it has no free space.

Procedure
  1. Let running Pulp tasks finish but do not trigger any new ones as they can fail due to the full disk.

  2. Ensure that the LV with the /var/lib/pulp directory on it has sufficient free space. Here are some ways to achieve that:

    1. Remove orphaned content:

      $ foreman-rake katello:delete_orphaned_content RAILS_ENV=production

      This is run weekly so it will not free much space.

    2. Change the download policy from Immediate to On Demand for as many repositories as possible and remove already downloaded packages.

    3. Grow the file system on the LV with the /var/lib/pulp directory on it.

      If you use an untypical file system (other than for example ext3, ext4, or xfs), you might need to unmount the file system so that it is not in use. In that case, complete the following steps:

      1. Stop orcharhino services:

        $ orcharhino-maintain service stop
      2. Grow the file system on the LV.

      3. Start orcharhino services:

        $ orcharhino-maintain service start
  3. If some Pulp tasks failed due to the full disk, run them again.

Reclaiming PostgreSQL space

The PostgreSQL database can use a large amount of disk space especially in heavily loaded deployments. Use this procedure to reclaim some of this disk space on orcharhino.

Procedure
  1. Stop all services, except for the postgresql service:

    $ orcharhino-maintain service stop --exclude postgresql
  2. Switch to the postgres user and reclaim space on the database:

    $ su - postgres -c 'vacuumdb --full --all'
  3. Start the other services when the vacuum completes:

    $ orcharhino-maintain service start

For more information about content settings, see Content settings in Administering orcharhino.

PostgreSQL tuning

orcharhino uses the PostgreSQL database for the storage of persistent context across a wide variety of tasks. The database sees an extensive usage is usually working on to provide the orcharhino with the data which it needs for its smooth functioning. This makes PostgreSQL a heavily used process which if tuned can have several benefits on the overall operational response of orcharhino.

The PostgreSQL authors recommend disabling Transparent Hugepage on servers running PostgreSQL. For more information, see Disable Transparent Hugepage.

You can apply a set of tunings to PostgreSQL to improve its response times, which will modify the postgresql.conf file.

Procedure
  1. Append /etc/foreman-installer/custom-hiera.yaml to tune PostgreSQL:

    postgresql::server::config_entries:
      max_connections: 1000
      shared_buffers: 2GB
      work_mem: 8MB
      autovacuum_vacuum_cost_limit: 2000
  2. Reconfigure your orcharhino:

    $ orcharhino-installer

You can use this to effectively tune down your orcharhino instance irrespective of a tuning profile.

In the above tuning configuration, there are a certain set of keys which we have altered:

  • max_connections: The key defines the maximum number of connections that can be accepted by the PostgreSQL processes that are running.

  • shared_buffers: The shared buffers define the memory used by all the active connections inside PostgreSQL to store the data for the different database operations. An optimal value for this will vary between 2 GiB to a maximum of 25% of your total system memory depending upon the frequency of the operations being conducted on orcharhino.

  • work_mem: The work_mem is the memory that is allocated on per process basis for PostgreSQL and is used to store the intermediate results of the operations that are being performed by the process. Setting this value to 8 MB should be more than enough for most of the intensive operations on orcharhino.

  • autovacuum_vacuum_cost_limit: The key defines the cost limit value for the vacuuming operation inside the autovacuum process to clean up the dead tuples inside the database relations. The cost limit defines the number of tuples that can be processed in a single run by the process. ATIX AG recommends setting the value to 2000 as it is for the medium, large, extra-large, and extra-extra-large profiles, based on the general load that orcharhino pushes on the PostgreSQL server process.

The text and illustrations on this page are licensed by ATIX AG under a Creative Commons Attribution Share Alike 4.0 International ("CC BY-SA 4.0") license. This page also contains text from the official Foreman documentation which uses the same license ("CC BY-SA 4.0").