Newer versions of Foreman come with a handy feature - fact and NIC filtering. When Foreman manages hypervisors or container hosts with many bridge or virtual devices, fact names are too often updated and when under heavy load, database locks or rollbacks can happen as fact uploads are one of the most common API calls. Also for each individual NIC reported, Foreman creates a NIC entry and by design it never deletes those from the database. This can lead to situations when hypervisors and container hosts are assigned thousands of NICs when more and more VMs (or containers) are spawned. This slows down performance of various actions, most importantly fact import.
When deploying Foreman on CentOS 7, you by default get PostgreSQL 9.2 as packaged in CentOS (and RHEL). However PostgreSQL 9.2 is officially EOL upstream and newer versions bring various performance improvements which might benefit the Foreman installation. This post will show how to deploy Foreman with PostgreSQL 9.6 from SoftwareCollections.org.