-
Notifications
You must be signed in to change notification settings - Fork 898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EUWE] Do not store ar object for old refresh #14673
Merged
simaishi
merged 7 commits into
ManageIQ:euwe
from
Ladas:do_not_store_ar_object_for_old_refresh_euwe
Apr 11, 2017
Merged
[EUWE] Do not store ar object for old refresh #14673
simaishi
merged 7 commits into
ManageIQ:euwe
from
Ladas:do_not_store_ar_object_for_old_refresh_euwe
Apr 11, 2017
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
miq-bot
changed the title
Do not store ar object for old refresh euwe
[EUWE] Do not store ar object for old refresh euwe
Apr 6, 2017
Ladas
changed the title
[EUWE] Do not store ar object for old refresh euwe
[EUWE] Do not store ar object for old refresh
Apr 6, 2017
agrare
approved these changes
Apr 11, 2017
@Ladas can you resolve the conflict? |
@simaishi is the result of #14542
|
Storing AR object around is causing memory bloat. While doing .reload on AR object is decreasing the memory bloat, it is adding a processing time, cause .reload does a SQL query per each object then. Therefore removing the AR object is decreasing memory required as well as the processing time.
Use :id instead of :_object for vms saving
Use :id instead of :_object for saving of cloud_tenants
Nullify array of the to be 'deleted' objects, this was causing a reference and the AR objects were not GCed then.
Do not build vm_and_templates through association, rails are caching all the objects there, making it huge in memory.
Use :id instead of :_object for NetworkManager saving. We can also delete processing of cross-manager links ( orchestration_stacks, vms, availability_zones, cloud_tenants) since those will be always AR objects. Only :device can be both Hash and AR object, so it's handled appropriatelly. The ignored cross-manager links processing was needed only when there were CloudManagers without NetworkManagers, so this is not backportable to Darga. Conflicts: app/models/ems_refresh/save_inventory_network.rb
Associate subnets with routers with less queries, 50% of the DB queries exactly.
Ladas
force-pushed
the
do_not_store_ar_object_for_old_refresh_euwe
branch
from
April 11, 2017 13:49
7628ff9
to
8307f2a
Compare
Checked commits Ladas/manageiq@e651717~...8307f2a with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 app/models/ems_refresh/save_inventory_network.rb
|
agrare
pushed a commit
to agrare/manageiq
that referenced
this pull request
Apr 19, 2017
…or_old_refresh_euwe [EUWE] Do not store ar object for old refresh (cherry picked from commit 1b5829b) https://bugzilla.redhat.com/show_bug.cgi?id=1441202
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A not clean cherry-pick of #13594
Storing AR object around is causing memory bloat. While
doing .reload on AR object is decreasing the memory bloat,
it is adding a processing time, cause .reload does a SQL query
per each object then.
Therefore removing the AR object is decreasing memory required
as well as the processing time.
Implements:
https://www.pivotaltracker.com/story/show/137741549