Bug 1580569
Summary: | UI Worker Exceeding Memory Trying to View Hosts for VMware Provider | |||
---|---|---|---|---|
Product: | Red Hat CloudForms Management Engine | Reporter: | myoder | |
Component: | Performance | Assignee: | Nick LaMuro <nlamuro> | |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Matouš Mojžíš <mmojzis> | |
Severity: | medium | Docs Contact: | ||
Priority: | high | |||
Version: | 5.8.0 | CC: | cpelland, dmetzger, hkataria, lavenel, mmojzis, mpovolny, obarenbo | |
Target Milestone: | GA | Keywords: | TestOnly, ZStream | |
Target Release: | 5.10.0 | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ui:infra:provider:host | |||
Fixed In Version: | 5.10.0.0 | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1583788 1583790 (view as bug list) | Environment: | ||
Last Closed: | 2019-02-11 14:05:41 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | Bug | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | CFME Core | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1583788, 1583790 |
Comment 7
Nick LaMuro
2018-05-23 16:21:50 UTC
I have put together an alternative set of patches that also fix the issue independently of the first couple: https://github.com/ManageIQ/manageiq/pull/17473 https://github.com/ManageIQ/manageiq/pull/17474 https://github.com/ManageIQ/manageiq/pull/17475 I forgot that another patch was really necessary, and that this one could work on it's own to a degree to solve this issue as well: https://github.com/ManageIQ/manageiq-ui-classic/pull/3989 This, without the above, would (re-)introduce an N+1, but that would be far better than the memory situation that we are currently dealing with. With the above 3 from PRs from comment 9, the N+1 is completely removed as well where ever `last_compliance_status` or `last_compliance_timezone` is needed. The final patch that we will be going forward with to fix the bug is https://github.com/ManageIQ/manageiq-ui-classic/pull/3989, and that will be merged into master shortly. Reason being is that fixes the issue on it's own, with limited impact to the rest of the system and only a minor compromise in database performance. Fix merged. To replicate this bug, you can run the following script to populate a fresh database with data to replicate the issue: https://gist.github.com/NickLaMuro/225833358423723ed17ff294415fa6b4 To run script, you can do the following in the project dir on an appliance: $ bin/rails r bz_1580569_db_replication_script.rb * * * To replicate the issue, the easiest way is through the console: $ bin/rails c irb> MiqReport.load_from_view_options(Host, User.where(:userid => 'admin').first).paged_view_search Without the patch, this will cause the process to consume roughly 10+ Gigs of RAM do to a poorly optimized database query. The patch (mentioned above) prevents this. Verified in 5.10.0.0. With provided script I was able to view 250 VmWare hosts without errors and view was loaded fast. Also this script was executed was with no issues: MiqReport.load_from_view_options(Host, User.where(:userid => 'admin').first).paged_view_search |