Bug 1462350 - unqualified search on hostgroup page results in large memory spike and potential OOM
unqualified search on hostgroup page results in large memory spike and potent...
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Host Group (Show other bugs)
6.2.10
Unspecified Unspecified
high Severity high (vote)
: 6.2.11
: --
Assigned To: Justin Sherrill
jcallaha
: FieldEngineering, PrioBumpField, Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-16 15:50 EDT by Justin Sherrill
Modified: 2017-08-10 13:02 EDT (History)
9 users (show)

See Also:
Fixed In Version: foreman-1.11.0.81-1
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1463802 (view as bug list)
Environment:
Last Closed: 2017-08-10 13:02:29 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 20038 None None None 2017-06-16 15:58 EDT

  None (edit)
Description Justin Sherrill 2017-06-16 15:50:56 EDT
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):
6.2.9/6.3.0

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 15:53:00 EDT
Sample user data:

> Hostgroup.count
=> 248

> Puppetclass.count
=> 234

> HostgroupClass.count
=> 2248
Comment 3 Justin Sherrill 2017-06-16 15:58:00 EDT
Created redmine issue http://projects.theforeman.org/issues/20038 from this bug
Comment 4 Justin Sherrill 2017-06-16 16:09 EDT
Created attachment 1288458 [details]
Patch
Comment 5 pm-sat@redhat.com 2017-06-16 16:11:40 EDT
Upstream bug assigned to jsherril@redhat.com
Comment 6 pm-sat@redhat.com 2017-06-16 16:11:43 EDT
Upstream bug assigned to jsherril@redhat.com
Comment 7 pm-sat@redhat.com 2017-06-18 08:12:50 EDT
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 15:56:32 EDT
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 15:57 EDT
Created attachment 1305640 [details]
verification screenshot
Comment 13 errata-xmlrpc 2017-08-10 13:02:29 EDT
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.

https://access.redhat.com/errata/RHBA-2017:2466

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