Bug 1462350 - unqualified search on hostgroup page results in large memory spike and potential OOM
Summary: unqualified search on hostgroup page results in large memory spike and potent...
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Host Group
Version: 6.2.10
Hardware: Unspecified
OS: Unspecified
Target Milestone: Unspecified
Assignee: Justin Sherrill
QA Contact: jcallaha
Depends On:
TreeView+ depends on / blocked
Reported: 2017-06-16 19:50 UTC by Justin Sherrill
Modified: 2021-06-10 12:27 UTC (History)
9 users (show)

Fixed In Version: foreman-
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1463802 (view as bug list)
Last Closed: 2017-08-10 17:02:29 UTC
Target Upstream Version:

Attachments (Terms of Use)
Patch (1005 bytes, patch)
2017-06-16 20:09 UTC, Justin Sherrill
no flags Details | Diff
verification screenshot (222.46 KB, image/png)
2017-07-27 19:57 UTC, jcallaha
no flags Details

System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 20038 0 None None None 2017-06-16 19:58:01 UTC
Red Hat Product Errata RHBA-2017:2466 0 normal SHIPPED_LIVE Satellite 6.2.11 Async Release 2017-08-10 21:01:20 UTC

Description Justin Sherrill 2017-06-16 19:50:56 UTC
Description of problem:

When you have a large number of host groups, and a large number of associated puppet classes, searching for hostgroups via the UI or api can cause a huge spike of memory if the search is unqualified (i.e. does not include 'field=value', but instead is just 'value').

Version-Release number of selected component (if applicable):

How reproducible:
Always (with user data)

Steps to Reproduce:
1.  On a system with lots of hostgroups and puppet class associations
2.  Navigate to config > hostgroups
3.  search for "FOO"  where FOO is the name of a hostgroup

Actual results:
Passenger memory balloons by many gigs, OOM killer may kick in

Expected results:
No major memory usage increase

Additional info:

Comment 1 Justin Sherrill 2017-06-16 19:53:00 UTC
Sample user data:

> Hostgroup.count
=> 248

> Puppetclass.count
=> 234

> HostgroupClass.count
=> 2248

Comment 3 Justin Sherrill 2017-06-16 19:58:00 UTC
Created redmine issue http://projects.theforeman.org/issues/20038 from this bug

Comment 4 Justin Sherrill 2017-06-16 20:09:34 UTC
Created attachment 1288458 [details]

Comment 5 Satellite Program 2017-06-16 20:11:40 UTC
Upstream bug assigned to jsherril

Comment 6 Satellite Program 2017-06-16 20:11:43 UTC
Upstream bug assigned to jsherril

Comment 7 Satellite Program 2017-06-18 12:12:50 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/20038 has been resolved.

Comment 10 jcallaha 2017-07-27 19:56:32 UTC
Verified in Satellite 6.2.11 Snap 2

I used the steps provided in the original description.

Hostgroups: 251
Puppet Classes per HG: 635

When performing the unqualified searches "clone", "clone10", "clone109"; no search took longer than 1.5s for the page to return. Average load times were around 600ms. See attached screenshot for search and browser timeline. Additionally, monitoring the memory usage in the machine showed no significant memory spikes.

Comment 11 jcallaha 2017-07-27 19:57:01 UTC
Created attachment 1305640 [details]
verification screenshot

Comment 13 errata-xmlrpc 2017-08-10 17:02:29 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.