-
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
Unique EmsRefresh.refresh targets if there are over 1,000 targets #16432
Unique EmsRefresh.refresh targets if there are over 1,000 targets #16432
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the biggest problem might be in OpenShift provider, but:
- We queue only DELETED events now, which are smaller
- We disable the InventoryCollectorWorker queuing if the Refresh worker dies
That means we should always be at quite low amount of targets queued, then the uniq per queuing is not that bad.
What this solves though is, that we just saw how refresh worker failure could have lead to having 2M targets queued, where it's just like 400 unique targets possible. The 2M targets were around 4GB in memory, killing all priority, Generic and Refresh workers that met it.
cc @cben
So I tried queueing 2 million targets for amazon as a test:
The resulting queue item had The RefreshWorker grew from 392MB to 1.2GB when dequeueing it. |
@Fryguy we saw this on a 5.9.0.9 appliance so the watch collector was disabled. I still think there is something else going on to allow this to happen (refresh worker should have dequeued this) but this certainly isn't helping matters. |
7ce5298
to
4e7b2c2
Compare
Okay @Fryguy this will uniq the target list every 1000 targets. 1000 |
app/models/ems_refresh.rb
Outdated
@@ -20,6 +20,10 @@ def self.debug_trace | |||
Settings.ems_refresh[:debug_trace] | |||
end | |||
|
|||
def self.max_targets_uniq_threshold | |||
Settings.ems_refresh[:max_targets_uniq_threshold] || 1_000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer Settings.ems_refresh.max_targets_uniq_threshold
and get rid of the || 1000
, because we will always have a value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On that note, why make it configurable at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, right, maybe this config doesn't make that much of a sense
4e7b2c2
to
3543058
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
3543058
to
d100b56
Compare
Checked commit agrare@d100b56 with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0 |
Linked to the new bug to track just this issue |
Unique EmsRefresh.refresh targets if there are over 1,000 targets (cherry picked from commit fdb09c2) https://bugzilla.redhat.com/show_bug.cgi?id=1517962
Gaprindashvili backport details:
|
RFC on if we should put back the unique check for ems_refresh targets
cc @Fryguy @Ladas
https://bugzilla.redhat.com/show_bug.cgi?id=1516401